refactor(接口测试): 优化接口报告状态默认值的大小写
This commit is contained in:
parent
30b9968dbe
commit
7d8e52cf8f
|
@ -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 '资源池' ,
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue