diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/SqlProcessorConverter.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/SqlProcessorConverter.java index 0850f57c18..110705ceac 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/SqlProcessorConverter.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/SqlProcessorConverter.java @@ -110,18 +110,18 @@ public abstract class SqlProcessorConverter extends MsProcessorConverter dataSources = envConfig.getConfig().getDataSources(); // 先按ID匹配 - dataSources = dataSources.stream() + List dataSourceResults = dataSources.stream() .filter(item -> StringUtils.equals(item.getId(), sqlProcessor.getDataSourceId())) .toList(); // 再按名称匹配 - if (CollectionUtils.isEmpty(dataSources)) { - dataSources = dataSources.stream() + if (CollectionUtils.isEmpty(dataSourceResults)) { + dataSourceResults = dataSources.stream() .filter(item -> StringUtils.equals(item.getDataSource(), sqlProcessor.getDataSourceName())) .toList(); } - return CollectionUtils.isEmpty(dataSources) ? null : dataSources.get(0); + return CollectionUtils.isEmpty(dataSourceResults) ? null : dataSourceResults.get(0); } protected AbstractJDBCProcessor getJdbcProcessor(SQLProcessor sqlProcessor, AbstractJDBCProcessor jdbcProcessor, DataSource dataSource) { diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/assertion/body/DocumentAssertionConverter.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/assertion/body/DocumentAssertionConverter.java index 384ebc1153..678804b71d 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/assertion/body/DocumentAssertionConverter.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/processor/assertion/body/DocumentAssertionConverter.java @@ -31,7 +31,6 @@ public class DocumentAssertionConverter extends ResponseBodyTypeAssertionConvert if (msAssertion == null) { return; } - // todo 定义好 jsonschema 再补充 if (needParse(msAssertion, config)) { String documentType = msAssertion.getDocumentType(); if (StringUtils.equals(documentType, MsDocumentAssertion.DocumentType.XML.name())) {