fix(接口测试): 解决接口自动化导入报错
--user=郭雨琦 --bug=1013016 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001013016
This commit is contained in:
parent
4c54671510
commit
71345cd360
|
@ -128,12 +128,14 @@ public class ApiScenarioImportUtil {
|
|||
private static ApiDefinition getApiDefinitionResult(JSONObject object, ApiDefinitionService apiDefinitionService,Map<String,ApiDefinition>definitionMap,Set<String> userRelatedProjectIds) {
|
||||
List<String> projectIds = new ArrayList<>(userRelatedProjectIds);
|
||||
ApiDefinitionExample apiDefinitionExample = new ApiDefinitionExample();
|
||||
apiDefinitionExample.createCriteria()
|
||||
.andPathEqualTo(object.getString("path"))
|
||||
.andMethodEqualTo(object.getString("method"))
|
||||
.andProtocolEqualTo(object.getString("protocol"))
|
||||
.andProjectIdIn(projectIds)
|
||||
.andStatusNotEqualTo("Trash");
|
||||
if(object.getString("path") != null && object.getString("method") != null){
|
||||
apiDefinitionExample.createCriteria()
|
||||
.andPathEqualTo(object.getString("path"))
|
||||
.andMethodEqualTo(object.getString("method"))
|
||||
.andProtocolEqualTo(object.getString("protocol"))
|
||||
.andProjectIdIn(projectIds)
|
||||
.andStatusNotEqualTo("Trash");
|
||||
}
|
||||
ApiDefinition apiDefinition = apiDefinitionService.getApiDefinition(apiDefinitionExample);
|
||||
if(apiDefinition==null){
|
||||
if(MapUtils.isEmpty(definitionMap)){
|
||||
|
|
Loading…
Reference in New Issue