diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/automation/GenScenarioRequest.java b/api-test/backend/src/main/java/io/metersphere/api/dto/automation/GenScenarioRequest.java index 8d36b3dc13..0f478de36c 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/automation/GenScenarioRequest.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/automation/GenScenarioRequest.java @@ -38,7 +38,7 @@ public class GenScenarioRequest extends ApiScenarioWithBLOBs { private RunModeConfigDTO config; private boolean isTestPlanScheduleJob = false; - //生成测试报告:当isTestPlanScheduleJob为ture时使用 + //生成测试报告:当isTestPlanScheduleJob为true时使用 private String testPlanReportId; private String requestOriginator; diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/automation/RunScenarioRequest.java b/api-test/backend/src/main/java/io/metersphere/api/dto/automation/RunScenarioRequest.java index 0d7e41dd59..c2bf2dbdc0 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/automation/RunScenarioRequest.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/automation/RunScenarioRequest.java @@ -43,7 +43,7 @@ public class RunScenarioRequest { private boolean isTestPlanScheduleJob = false; - //生成测试报告:当isTestPlanScheduleJob为ture时使用 + //生成测试报告:当isTestPlanScheduleJob为true时使用 private String testPlanReportId; private String requestOriginator; diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java b/api-test/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java index 7e82f8cb67..43da264cce 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/datacount/response/ApiDataCountDTO.java @@ -124,11 +124,11 @@ public class ApiDataCountDTO { private String interfaceCoverage = " 0%"; /** - * 对Protocal视角对查询结果进行统计 + * 对Protocol视角对查询结果进行统计 * * @param countResultList 查询参数 */ - public void countProtocal(List countResultList) { + public void countProtocol(List countResultList) { for (ApiDataCountResult countResult : countResultList) { switch (countResult.getGroupField().toUpperCase()) { diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/datacount/response/CoverageDTO.java b/api-test/backend/src/main/java/io/metersphere/api/dto/datacount/response/CoverageDTO.java index 02517b6b99..f590f694ca 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/datacount/response/CoverageDTO.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/datacount/response/CoverageDTO.java @@ -7,6 +7,6 @@ import lombok.Setter; @Setter public class CoverageDTO { public String rateOfCoverage = "0%"; - public long coverate = 0; - public long notCoverate = 0; + public long coverage = 0; + public long notCoverage = 0; } diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/share/ApiDocumentInfoDTO.java b/api-test/backend/src/main/java/io/metersphere/api/dto/share/ApiDocumentInfoDTO.java index de40cbf9ab..95bfb88a4e 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/share/ApiDocumentInfoDTO.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/share/ApiDocumentInfoDTO.java @@ -29,7 +29,7 @@ public class ApiDocumentInfoDTO { private String restParams; private String requestBodyParamType; private String requestBodyFormData; - private String requestBodyStrutureData; + private String requestBodyStructureData; private Object requestPreviewData; private JSONSchemaBodyDTO jsonSchemaBody; @@ -38,7 +38,7 @@ public class ApiDocumentInfoDTO { private Object jsonSchemaResponseBody; private String responseBodyParamType; private String responseBodyFormData; - private String responseBodyStrutureData; + private String responseBodyStructureData; private String responseCode; private boolean sharePopoverVisible = false; diff --git a/api-test/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java b/api-test/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java index 878074434f..9fc7f35997 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java +++ b/api-test/backend/src/main/java/io/metersphere/api/jmeter/TestResult.java @@ -105,13 +105,13 @@ public class TestResult { //如果有全局前后置脚本,会出现前后置的测试步骤,影响统计。此处略过不处理。 // 同时,jmeter会将前后置脚本步骤作为一个请求来计算。当检测到有前后置脚本步骤执行时,请求数也要做处理 - List formatedResult = new ArrayList<>(); + List formattedResult = new ArrayList<>(); int successStep = 0; int errorStep = 0; for (RequestResult item :result.getRequestResults()) { if(!StringUtils.startsWithAny(item.getName(),"PRE_PROCESSOR_ENV_","POST_PROCESSOR_ENV_")){ - formatedResult.add(item); + formattedResult.add(item); }else { if(StringUtils.equalsAnyIgnoreCase(item.getName(),"PRE_PROCESSOR_ENV_false","POST_PROCESSOR_ENV_false")){ if(item.isSuccess()){ @@ -128,7 +128,7 @@ public class TestResult { this.error = this.error-errorStep; this.total = this.total - successStep - errorStep; - result.setRequestResults(formatedResult); + result.setRequestResults(formattedResult); result.getRequestResults().forEach(item -> { String itemAndScenarioName = StringUtils.EMPTY; diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/HarScenarioAbstractParser.java b/api-test/backend/src/main/java/io/metersphere/api/parse/HarScenarioAbstractParser.java index 5d191b4631..f7af7e7177 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/HarScenarioAbstractParser.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/HarScenarioAbstractParser.java @@ -1,31 +1,20 @@ package io.metersphere.api.parse; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; -import io.metersphere.api.dto.definition.request.processors.pre.MsJSR223PreProcessor; import io.metersphere.api.dto.definition.request.sampler.MsHTTPSamplerProxy; import io.metersphere.api.dto.scenario.Body; import io.metersphere.api.dto.scenario.KeyValue; import io.metersphere.api.parse.api.har.model.*; -import io.metersphere.api.parse.postman.PostmanEvent; -import io.metersphere.api.parse.postman.PostmanKeyValue; -import io.metersphere.api.parse.postman.PostmanRequest; -import io.metersphere.api.parse.postman.PostmanScript; -import io.metersphere.commons.constants.ElementConstants; -import io.metersphere.commons.constants.MsRequestBodyType; -import io.metersphere.commons.constants.PostmanRequestBodyMode; -import io.metersphere.commons.utils.JSON; import io.metersphere.commons.utils.JSONUtil; import io.metersphere.commons.utils.XMLUtil; -import io.metersphere.plugin.core.MsTestElement; import io.swagger.v3.oas.models.media.Schema; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.json.JSONObject; -import java.util.*; -import java.util.stream.Collectors; +import java.util.HashMap; +import java.util.List; +import java.util.Map; public abstract class HarScenarioAbstractParser extends ApiImportAbstractParser { @@ -50,9 +39,9 @@ public abstract class HarScenarioAbstractParser extends ApiImportAbstractPars } private void parseParameters(HarRequest harRequest, MsHTTPSamplerProxy request) { - List queryStringList = harRequest.queryString; - queryStringList.forEach(harQueryParm -> { - parseQueryParameters(harQueryParm, request.getArguments()); + List queryStringList = harRequest.queryString; + queryStringList.forEach(harQueryParam -> { + parseQueryParameters(harQueryParam, request.getArguments()); }); List harHeaderList = harRequest.headers; harHeaderList.forEach(harHeader -> { @@ -138,8 +127,8 @@ public abstract class HarScenarioAbstractParser extends ApiImportAbstractPars } - private void parseQueryParameters(HarQueryParm harQueryParm, List arguments) { - arguments.add(new KeyValue(harQueryParm.name, harQueryParm.value, harQueryParm.comment, false)); + private void parseQueryParameters(HarQueryParam harQueryParam, List arguments) { + arguments.add(new KeyValue(harQueryParam.name, harQueryParam.value, harQueryParam.comment, false)); } private void parseCookieParameters(HarCookie harCookie, List headers) { @@ -150,99 +139,11 @@ public abstract class HarScenarioAbstractParser extends ApiImportAbstractPars addHeader(headers, harHeader.name, harHeader.value, harHeader.comment, StringUtils.EMPTY, false); } - private void addPreScript(MsHTTPSamplerProxy request, List event) { - if (request != null && CollectionUtils.isNotEmpty(event)) { - StringBuilder scriptStr = new StringBuilder(); - event = event.stream() - .filter(item -> item.getScript() != null) - .collect(Collectors.toList()); - event.forEach(item -> { - PostmanScript script = item.getScript(); - if (script != null && item.getListen().contains("prerequest")) { - List exec = script.getExec(); - if (CollectionUtils.isNotEmpty(exec)) { - exec.forEach(col -> { - if (StringUtils.isNotEmpty(col)) { - scriptStr.append(col + StringUtils.LF); - } - }); - } - } - }); - if (StringUtils.isNotBlank(scriptStr)) { - MsJSR223PreProcessor jsr223PreProcessor = new MsJSR223PreProcessor(); - jsr223PreProcessor.setName(ElementConstants.JSR223_PRE); - jsr223PreProcessor.setScriptLanguage("javascript"); - jsr223PreProcessor.setScript(scriptStr.toString()); - LinkedList hashTree = new LinkedList<>(); - hashTree.add(jsr223PreProcessor); - request.setHashTree(hashTree); - } - } - } - - private List parseKeyValue(List postmanKeyValues) { - if (postmanKeyValues == null) { - return null; - } - List keyValues = new ArrayList<>(); - postmanKeyValues.forEach(item -> keyValues.add(new KeyValue(item.getKey(), item.getValue(), item.getDescription(), item.getContentType()))); - return keyValues; - } - - private void parseBody(Body body, PostmanRequest requestDesc) { - ObjectNode postmanBody = requestDesc.getBody(); - if (postmanBody == null) { - return; - } - String bodyMode = postmanBody.get("mode").textValue(); - if (StringUtils.isBlank(bodyMode)) { - return; - } - if (StringUtils.equals(bodyMode, PostmanRequestBodyMode.RAW.value())) { - parseRawBody(body, postmanBody, bodyMode); - } else if (StringUtils.equalsAny(bodyMode, PostmanRequestBodyMode.FORM_DATA.value(), PostmanRequestBodyMode.URLENCODED.value())) { - List postmanKeyValues = JSON.parseArray(postmanBody.get(bodyMode).textValue(), PostmanKeyValue.class); - body.setKvs(parseKeyValue(postmanKeyValues)); - if (StringUtils.equals(bodyMode, PostmanRequestBodyMode.FORM_DATA.value())) { - body.setType(Body.FORM_DATA); - } else if (StringUtils.equals(bodyMode, PostmanRequestBodyMode.URLENCODED.value())) { - body.setType(Body.WWW_FROM); - } - } else if (StringUtils.equals(bodyMode, PostmanRequestBodyMode.FILE.value())) { - body.setType(Body.BINARY); - body.setKvs(new ArrayList<>()); - } - } - private String parseXmlBody(String xmlString) { JSONObject object = JSONUtil.parseObject(getDefaultStringValue(xmlString)); return XMLUtil.jsonToXmlStr(object); } - private void parseRawBody(Body body, ObjectNode postmanBody, String bodyMode) { - body.setRaw(postmanBody.get(bodyMode).textValue()); - body.setType(MsRequestBodyType.RAW.value()); - JsonNode options = postmanBody.get("options"); - if (options != null) { - JsonNode raw = options.get(PostmanRequestBodyMode.RAW.value()); - if (raw != null) { - String bodyType = StringUtils.EMPTY; - switch (raw.get("language").textValue()) { - case "json": - bodyType = Body.JSON_STR; - break; - case "xml": - bodyType = Body.XML; - break; - default: - bodyType = Body.RAW; - } - body.setType(bodyType); - } - } - } - private String getDefaultStringValue(String val) { return StringUtils.isBlank(val) ? StringUtils.EMPTY : val; } diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/JmeterDocumentParser.java b/api-test/backend/src/main/java/io/metersphere/api/parse/JmeterDocumentParser.java index 93872f1ba8..3a68cdc814 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/JmeterDocumentParser.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/JmeterDocumentParser.java @@ -190,9 +190,9 @@ public class JmeterDocumentParser { // 解析访问地址 if (url.contains("?")) { - String[] strUrlPatten = url.split("\\?"); - strUrl = strUrlPatten[0]; - strUrlParams = strUrlPatten[1]; + String[] strUrlPattern = url.split("\\?"); + strUrl = strUrlPattern[0]; + strUrlParams = strUrlPattern[1]; } else { strUrl = url; diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/api/ESBParser.java b/api-test/backend/src/main/java/io/metersphere/api/parse/api/ESBParser.java index b9a2ff7d70..b40cb41816 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/api/ESBParser.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/api/ESBParser.java @@ -87,7 +87,7 @@ public class ESBParser extends EsbAbstractParser { XSSFWorkbook workbook = new XSSFWorkbook(); XSSFFont font = workbook.createFont(); font.setFontHeightInPoints((short) 9); - Map cellStyleMap = createCellStle(workbook); + Map cellStyleMap = createCellStyle(workbook); XSSFSheet headSheet = workbook.createSheet("公共报文头"); generateSheet(headSheet, font, cellStyleMap); XSSFSheet bodySheet = workbook.createSheet("接口报文信息"); @@ -95,7 +95,7 @@ public class ESBParser extends EsbAbstractParser { return workbook; } - private static Map createCellStle(XSSFWorkbook workbook) { + private static Map createCellStyle(XSSFWorkbook workbook) { Map cellStype = new HashMap<>(); short[] colorIndexArr = {IndexedColors.LIGHT_GREEN.getIndex(), IndexedColors.ORCHID.getIndex(), IndexedColors.YELLOW.getIndex()}; for (short colorIndex : colorIndexArr) { diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/api/HarParser.java b/api-test/backend/src/main/java/io/metersphere/api/parse/api/HarParser.java index cce1193570..8d3cdeea7b 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/api/HarParser.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/api/HarParser.java @@ -118,9 +118,9 @@ public class HarParser extends HarAbstractParser { } private void parseParameters(HarRequest harRequest, MsHTTPSamplerProxy request) { - List queryStringList = harRequest.queryString; - queryStringList.forEach(harQueryParm -> { - parseQueryParameters(harQueryParm, request.getArguments()); + List queryStringList = harRequest.queryString; + queryStringList.forEach(harQueryParam -> { + parseQueryParameters(harQueryParam, request.getArguments()); }); List harHeaderList = harRequest.headers; harHeaderList.forEach(harHeader -> { @@ -278,7 +278,7 @@ public class HarParser extends HarAbstractParser { return XMLUtil.jsonToXmlStr(object); } - private void parseQueryParameters(HarQueryParm harQueryParm, List arguments) { - arguments.add(new KeyValue(harQueryParm.name, harQueryParm.value, harQueryParm.comment, false)); + private void parseQueryParameters(HarQueryParam harQueryParam, List arguments) { + arguments.add(new KeyValue(harQueryParam.name, harQueryParam.value, harQueryParam.comment, false)); } } diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/api/JMeterScriptUtil.java b/api-test/backend/src/main/java/io/metersphere/api/parse/api/JMeterScriptUtil.java index 86f97e5f63..27002e7e55 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/api/JMeterScriptUtil.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/api/JMeterScriptUtil.java @@ -20,13 +20,13 @@ public class JMeterScriptUtil { /** * 判断脚本是否被过滤 * - * @param filterProtocals 要过滤掉的请求类型 - * @param protocal 当前请求类型 + * @param filterProtocols 要过滤掉的请求类型 + * @param protocol 当前请求类型 * @return */ - public static boolean isScriptFilter(List filterProtocals, String protocal) { - if (!CollectionUtils.isEmpty(filterProtocals)) { - return filterProtocals.contains(protocal); + public static boolean isScriptFilter(List filterProtocols, String protocol) { + if (!CollectionUtils.isEmpty(filterProtocols)) { + return filterProtocols.contains(protocol); } else { return false; } @@ -62,26 +62,26 @@ public class JMeterScriptUtil { * @param envConfig 环境配置信息 * @param samplerHashTree sampler的hashtree * @param isAfterPrivateScript 是否将脚本放置在sampler的私有脚本之后 - * @param protocal 请求类型 + * @param protocol 请求类型 * @param environmentId 环境ID * @param config 参数配置 */ - public static void setScriptByEnvironmentConfig(EnvironmentConfig envConfig, HashTree samplerHashTree, String protocal, String environmentId, ParameterConfig config, boolean isAfterPrivateScript) { + public static void setScriptByEnvironmentConfig(EnvironmentConfig envConfig, HashTree samplerHashTree, String protocol, String environmentId, ParameterConfig config, boolean isAfterPrivateScript) { GlobalScriptConfig globalScriptConfig = envConfig != null ? envConfig.getGlobalScriptConfig() : null; MsJSR223PreProcessor preProcessor = JMeterScriptUtil.getPreScript(envConfig); MsJSR223PostProcessor postProcessor = JMeterScriptUtil.getPostScript(envConfig); - setScript(globalScriptConfig, protocal, isAfterPrivateScript, environmentId, config, samplerHashTree, preProcessor, postProcessor); + setScript(globalScriptConfig, protocol, isAfterPrivateScript, environmentId, config, samplerHashTree, preProcessor, postProcessor); } - public static void setScript(GlobalScriptConfig globalScriptConfig, String protocal, boolean isAfterPrivateScript, String environmentId, ParameterConfig config, + public static void setScript(GlobalScriptConfig globalScriptConfig, String protocol, boolean isAfterPrivateScript, String environmentId, ParameterConfig config, HashTree samplerHashTree, MsJSR223PreProcessor preProcessor, MsJSR223PostProcessor postProcessor) { boolean isPreScriptExecAfterPrivateScript = globalScriptConfig == null ? false : globalScriptConfig.isPreScriptExecAfterPrivateScript(); boolean isPostScriptExecAfterPrivateScript = globalScriptConfig == null ? false : globalScriptConfig.isPostScriptExecAfterPrivateScript(); - List preFilterProtocal = globalScriptConfig == null ? null : globalScriptConfig.getFilterRequestPreScript(); - List postFilterProtocal = globalScriptConfig == null ? null : globalScriptConfig.getFilterRequestPostScript(); - boolean globalPreScriptIsFilter = JMeterScriptUtil.isScriptFilter(preFilterProtocal, protocal); - boolean globalPostScriptIsFilter = JMeterScriptUtil.isScriptFilter(postFilterProtocal, protocal); + List preFilterProtocol = globalScriptConfig == null ? null : globalScriptConfig.getFilterRequestPreScript(); + List postFilterProtocol = globalScriptConfig == null ? null : globalScriptConfig.getFilterRequestPostScript(); + boolean globalPreScriptIsFilter = JMeterScriptUtil.isScriptFilter(preFilterProtocol, protocol); + boolean globalPostScriptIsFilter = JMeterScriptUtil.isScriptFilter(postFilterProtocol, protocol); if (isAfterPrivateScript) { if (isPreScriptExecAfterPrivateScript && !globalPreScriptIsFilter && preProcessor != null && StringUtils.isNotEmpty(preProcessor.getScript())) { addItemHashTree(preProcessor, samplerHashTree, config, environmentId); diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/api/har/model/HarQueryParm.java b/api-test/backend/src/main/java/io/metersphere/api/parse/api/har/model/HarQueryParam.java similarity index 87% rename from api-test/backend/src/main/java/io/metersphere/api/parse/api/har/model/HarQueryParm.java rename to api-test/backend/src/main/java/io/metersphere/api/parse/api/har/model/HarQueryParam.java index 1ffb8d6a14..372c847f04 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/api/har/model/HarQueryParm.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/api/har/model/HarQueryParam.java @@ -21,7 +21,7 @@ package io.metersphere.api.parse.api.har.model; -public class HarQueryParm { +public class HarQueryParam { public String name; @@ -45,7 +45,7 @@ public class HarQueryParm { @Override public boolean equals(Object obj) { - if(!(obj instanceof HarQueryParm)) { + if(!(obj instanceof HarQueryParam)) { return false; } @@ -53,8 +53,8 @@ public class HarQueryParm { return false; } - HarQueryParm harQueryParm = (HarQueryParm) obj; - return this.name.equals(harQueryParm.name); + HarQueryParam harQueryParam = (HarQueryParam) obj; + return this.name.equals(harQueryParam.name); } } diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/api/har/model/HarRequest.java b/api-test/backend/src/main/java/io/metersphere/api/parse/api/har/model/HarRequest.java index f869be4b0e..87fb2e53c7 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/api/har/model/HarRequest.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/api/har/model/HarRequest.java @@ -37,7 +37,7 @@ public class HarRequest { public List headers; - public List queryString; + public List queryString; public HarPostData postData; diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/ApiScenarioImportUtil.java b/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/ApiScenarioImportUtil.java index fc361163d9..34e19c209a 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/ApiScenarioImportUtil.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/ApiScenarioImportUtil.java @@ -198,8 +198,8 @@ public class ApiScenarioImportUtil { public static ApiDefinitionResult structureApiDefinitionByJson(ApiDefinitionService apiDefinitionService, JSONObject object, String versionId, String projectId, ApiDefinitionMapper apiDefinitionMapper, Map definitionMap) { ApiDefinitionResult test = new ApiDefinitionResult(); apiDefinitionService.checkQuota(projectId); - String protocal = object.optString("protocal"); - if (StringUtils.equals(protocal, "DUBBO")) { + String protocol = object.optString("protocol"); + if (StringUtils.equals(protocol, "DUBBO")) { test.setMethod("dubbo://"); } else { test.setMethod(object.optString("method")); diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/EsbDataParser.java b/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/EsbDataParser.java index 716d52e81f..fb9afb380e 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/EsbDataParser.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/EsbDataParser.java @@ -70,22 +70,22 @@ public class EsbDataParser { EsbDataStruct returnData = null; if (paramArr.length > index) { String param = paramArr[index]; - for (EsbDataStruct dataStuct : esbDataList) { - if (StringUtils.equals(dataStuct.getName(), param)) { + for (EsbDataStruct dataStruct : esbDataList) { + if (StringUtils.equals(dataStruct.getName(), param)) { int newIndex = index + 1; - if (paramArr.length > newIndex && dataStuct.getChildren() != null) { - EsbDataStruct childElement = selectEsbDataStructByNameStruct(dataStuct.getChildren(), paramArr, newIndex); + if (paramArr.length > newIndex && dataStruct.getChildren() != null) { + EsbDataStruct childElement = selectEsbDataStructByNameStruct(dataStruct.getChildren(), paramArr, newIndex); if (childElement != null) { - returnData = dataStuct.copy(false); + returnData = dataStruct.copy(false); returnData.getChildren().add(childElement); } } else { - returnData = dataStuct.copy(true); + returnData = dataStruct.copy(true); } } else if (index == 0) { //如果是第一个节点不符合,则遍历子节点是否有符合的。 int newIndex = index; - EsbDataStruct itemData = selectEsbDataStructByNameStruct(dataStuct.getChildren(), paramArr, newIndex); + EsbDataStruct itemData = selectEsbDataStructByNameStruct(dataStruct.getChildren(), paramArr, newIndex); if (itemData != null) { returnData = itemData; } diff --git a/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/HarScenarioParser.java b/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/HarScenarioParser.java index ee1818dea6..7e00aa46c0 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/HarScenarioParser.java +++ b/api-test/backend/src/main/java/io/metersphere/api/parse/scenario/HarScenarioParser.java @@ -84,7 +84,7 @@ public class HarScenarioParser extends HarScenarioAbstractParser if (samplerProxy.getBody() != null) { List keyValueList = new ArrayList<>(); if (!ObjectUtils.isEmpty(request.queryString)) { - for (HarQueryParm model : request.queryString) { + for (HarQueryParam model : request.queryString) { KeyValue keyValue = new KeyValue(model.name, model.value); keyValueList.add(keyValue); } diff --git a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.java b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.java index e4e4bce9d8..c6eb8b8a10 100644 --- a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.java +++ b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.java @@ -28,7 +28,7 @@ public interface ExtApiDefinitionExecResultMapper { long countByTestCaseIDInProject(String projectId); - List findFaliureCaseInTestPlanByProjectIDAndExecuteTimeAndLimitNumber(@Param("projectId") String projectId, @Param("selectFunctionCase") boolean selectFunctionCase, @Param("startTimestamp") long startTimestamp); + List findFailureCaseInTestPlanByProjectIDAndExecuteTimeAndLimitNumber(@Param("projectId") String projectId, @Param("selectFunctionCase") boolean selectFunctionCase, @Param("startTimestamp") long startTimestamp); String selectExecResult(String resourceId); diff --git a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml index 462c6e99ad..c830ecadee 100644 --- a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml +++ b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionExecResultMapper.xml @@ -65,7 +65,7 @@ WHERE integrated_report_id = #{0} -