From 5b05eadeb856fb1949df15454f0bafd515343b0f Mon Sep 17 00:00:00 2001 From: zhangdahai112 Date: Tue, 9 Aug 2022 18:13:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(idea=20=E6=8F=92=E4=BB=B6):=20=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=8E=A5=E5=8F=A3=E7=A9=BA=E6=8C=87=E9=92=88=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/api/service/ApiDefinitionService.java | 4 ++-- .../java/io/metersphere/api/service/ApiModuleService.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index 0c786418d7..8145afd141 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -994,7 +994,7 @@ public class ApiDefinitionService { apiTestCaseWithBLOBs.setApiDefinitionId(apiDefinition.getId()); apiTestCaseWithBLOBs.setCreateUserId(Objects.requireNonNull(SessionUtils.getUser()).getId()); apiTestCaseWithBLOBs.setUpdateUserId(Objects.requireNonNull(SessionUtils.getUser()).getId()); - if (apiDefinition.getToBeUpdated() != null && !apiTestCaseWithBLOBs.getVersionId().equals("cover")) { + if (apiDefinition.getToBeUpdated() != null && !StringUtils.equalsIgnoreCase(apiTestCaseWithBLOBs.getVersionId(), "cover")) { apiTestCaseWithBLOBs.setToBeUpdated(true); //TODO:check setting } else { @@ -1153,7 +1153,7 @@ public class ApiDefinitionService { if (CollectionUtils.isEmpty(caseList)) { apiDefinition.setToBeUpdated(false); } else { - List cover = caseList.stream().filter(t -> !t.getVersionId().equals("cover") && StringUtils.isNotBlank(t.getId())).collect(Collectors.toList()); + List cover = caseList.stream().filter(t -> !StringUtils.equalsIgnoreCase("cover", t.getVersionId()) && StringUtils.isNotBlank(t.getId())).collect(Collectors.toList()); if (CollectionUtils.isEmpty(cover)) { apiDefinition.setToBeUpdated(false); } else { diff --git a/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java b/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java index 523ac85dc0..402f7bae37 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiModuleService.java @@ -1346,7 +1346,7 @@ public class ApiModuleService extends NodeTreeService { } List caseWithBLOBs = definitionIdCaseMAp.get(apiDefinitionWithBLOBs.getId()); if (CollectionUtils.isNotEmpty(caseWithBLOBs)) { - return caseWithBLOBs.stream().filter(t -> !t.getVersionId().equals("create_repeat")).collect(Collectors.toMap(ApiTestCase::getName, testCase -> testCase)); + return caseWithBLOBs.stream().filter(t -> !StringUtils.equalsIgnoreCase("create_repeat", t.getVersionId())).collect(Collectors.toMap(ApiTestCase::getName, testCase -> testCase)); } else { return null; }