fix(接口测试): 修复执行没有csv文件的场景没有提示的缺陷

This commit is contained in:
wxg0103 2022-08-11 15:28:36 +08:00 committed by 刘瑞斌
parent b3cd96b63e
commit f5ab742d5e
2 changed files with 4 additions and 2 deletions

View File

@ -39,7 +39,7 @@ public class Swagger2Parser extends SwaggerAbstractParser {
if (StringUtils.isNotBlank(request.getSwaggerUrl())) {
try {
// 使用 url 导入 swagger
swagger = new SwaggerParser().read(request.getSwaggerUrl(), auths, true);
swagger = new SwaggerParser().read(request.getSwaggerUrl(), auths, false);
} catch (Exception e) {
LoggerUtil.error(e);
MSException.throwException(e.getMessage());

View File

@ -113,7 +113,9 @@ public class ElementUtil {
csvDataSet.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TestBeanGUI"));
csvDataSet.setName(StringUtils.isEmpty(item.getName()) ? "CSVDataSet" : item.getName());
csvDataSet.setProperty("fileEncoding", StringUtils.isEmpty(item.getEncoding()) ? "UTF-8" : item.getEncoding());
if (CollectionUtils.isNotEmpty(item.getFiles())) {
if (CollectionUtils.isEmpty(item.getFiles())) {
MSException.throwException(StringUtils.isEmpty(item.getName()) ? "CSVDataSet" : item.getName() + "[ CSV文件不存在 ]");
} else {
if (!config.isOperating() && !new File(BODY_FILE_DIR + "/" + item.getFiles().get(0).getId() + "_" + item.getFiles().get(0).getName()).exists()) {
MSException.throwException(StringUtils.isEmpty(item.getName()) ? "CSVDataSet" : item.getName() + "[ CSV文件不存在 ]");
}