fix(接口测试): 修复特殊tcp用例切换环境执行不起作用的缺陷

--bug=1027872 --user=王孝刚 【接口测试】tcpcase可以执行成功-加入到接口场景里执行失败
https://www.tapd.cn/55049933/s/1394930
This commit is contained in:
wxg0103 2023-07-19 10:09:28 +08:00 committed by fit2-zhao
parent bde2a76e88
commit bb8166f79d
2 changed files with 4 additions and 0 deletions

View File

@ -883,6 +883,9 @@ public class MockConfigService {
RequestMockParams requestMockParams = MockApiUtils.genRequestMockParamsFromHttpRequest(request, false);
String urlSuffix = this.getUrlSuffix(project.getSystemId(), request);
LogUtil.info("Mock urlSuffix:{}", urlSuffix);
LogUtil.info("Mock requestHeaderMap:{}", requestHeaderMap);
LogUtil.info("Mock requestMockParams:{}", requestMockParams);
List<ApiDefinitionWithBLOBs> qualifiedApiList = apiDefinitionService.preparedUrl(project.getId(), method, urlSuffix, requestHeaderMap.get(MockApiHeaders.MOCK_API_RESOURCE_ID));
/*
GET/DELETE 这种通过url穿参数的接口在接口路径相同的情况下可能会出现这样的情况

View File

@ -575,6 +575,7 @@ export default {
mergeRequestDocumentData(data.request);
if (data.apiMethod !== 'SQL' && data.apiMethod !== 'DUBBO' && data.apiMethod !== 'dubbo://') {
data.request.useEnvironment = this.environment;
data.request.environmentId = this.environment;
} else {
data.request.useEnvironment = data.request.environmentId;
}