refactor(接口测试): 优化接口报告状态默认值的大小写

This commit is contained in:
wxg0103 2024-02-20 13:54:51 +08:00 committed by wxg0103
parent 30b9968dbe
commit 7d8e52cf8f
2 changed files with 9 additions and 3 deletions

View File

@ -112,7 +112,7 @@ CREATE TABLE IF NOT EXISTS api_report(
`start_time` BIGINT NOT NULL COMMENT '开始时间/同创建时间一致' ,
`end_time` BIGINT COMMENT '结束时间/报告执行完成' ,
`request_duration` BIGINT NOT NULL DEFAULT 0 COMMENT '请求总耗时' ,
`status` VARCHAR(20) NOT NULL DEFAULT 'Pending' COMMENT '报告状态/SUCCESS/ERROR' ,
`status` VARCHAR(20) NOT NULL DEFAULT 'PENDING' COMMENT '报告状态/SUCCESS/ERROR' ,
`trigger_mode` VARCHAR(20) NOT NULL COMMENT '触发方式' ,
`run_mode` VARCHAR(20) NOT NULL COMMENT '执行模式' ,
`pool_id` VARCHAR(50) NOT NULL COMMENT '资源池' ,
@ -353,7 +353,7 @@ CREATE TABLE IF NOT EXISTS api_scenario_report(
`start_time` BIGINT NOT NULL COMMENT '开始时间/同创建时间一致' ,
`end_time` BIGINT COMMENT '结束时间/报告执行完成' ,
`request_duration` BIGINT NOT NULL DEFAULT 0 COMMENT '请求总耗时' ,
`status` VARCHAR(20) NOT NULL DEFAULT 'Pending' COMMENT '报告状态/SUCCESS/ERROR' ,
`status` VARCHAR(20) NOT NULL DEFAULT 'PENDING' COMMENT '报告状态/SUCCESS/ERROR' ,
`trigger_mode` VARCHAR(20) NOT NULL COMMENT '触发方式' ,
`run_mode` VARCHAR(20) NOT NULL COMMENT '执行模式' ,
`pool_id` VARCHAR(50) NOT NULL COMMENT '资源池' ,

View File

@ -75,12 +75,18 @@ public class UserLocalConfigService {
public boolean validate(String id) {
UserLocalConfig userLocalConfig = checkResourceById(id);
HttpURLConnection connection = null;
try {
URI url = new URI(userLocalConfig.getUserUrl());
HttpURLConnection connection = (HttpURLConnection) url.toURL().openConnection();
connection = (HttpURLConnection) url.toURL().openConnection();
connection.setConnectTimeout(3000);
return connection.getResponseCode() == HttpURLConnection.HTTP_OK;
} catch (Exception e) {
return false;
} finally {
if (connection != null) {
connection.disconnect();
}
}
}