fix(接口测试): 修复执行没有csv文件的场景没有提示的缺陷
This commit is contained in:
parent
b3cd96b63e
commit
f5ab742d5e
|
@ -39,7 +39,7 @@ public class Swagger2Parser extends SwaggerAbstractParser {
|
||||||
if (StringUtils.isNotBlank(request.getSwaggerUrl())) {
|
if (StringUtils.isNotBlank(request.getSwaggerUrl())) {
|
||||||
try {
|
try {
|
||||||
// 使用 url 导入 swagger
|
// 使用 url 导入 swagger
|
||||||
swagger = new SwaggerParser().read(request.getSwaggerUrl(), auths, true);
|
swagger = new SwaggerParser().read(request.getSwaggerUrl(), auths, false);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LoggerUtil.error(e);
|
LoggerUtil.error(e);
|
||||||
MSException.throwException(e.getMessage());
|
MSException.throwException(e.getMessage());
|
||||||
|
|
|
@ -113,7 +113,9 @@ public class ElementUtil {
|
||||||
csvDataSet.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TestBeanGUI"));
|
csvDataSet.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TestBeanGUI"));
|
||||||
csvDataSet.setName(StringUtils.isEmpty(item.getName()) ? "CSVDataSet" : item.getName());
|
csvDataSet.setName(StringUtils.isEmpty(item.getName()) ? "CSVDataSet" : item.getName());
|
||||||
csvDataSet.setProperty("fileEncoding", StringUtils.isEmpty(item.getEncoding()) ? "UTF-8" : item.getEncoding());
|
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()) {
|
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文件不存在 ]");
|
MSException.throwException(StringUtils.isEmpty(item.getName()) ? "CSVDataSet" : item.getName() + ":[ CSV文件不存在 ]");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue