fix(接口测试): 执行时按名称匹配数据源失效
This commit is contained in:
parent
5365e7818c
commit
73cf6fb06b
|
@ -110,18 +110,18 @@ public abstract class SqlProcessorConverter extends MsProcessorConverter<SQLProc
|
|||
List<DataSource> dataSources = envConfig.getConfig().getDataSources();
|
||||
|
||||
// 先按ID匹配
|
||||
dataSources = dataSources.stream()
|
||||
List<DataSource> 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) {
|
||||
|
|
|
@ -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())) {
|
||||
|
|
Loading…
Reference in New Issue