From 99567c9797962a19c5453d9cbb34f76d13d5c2ea Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Mon, 13 May 2024 19:33:27 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=94=A8=E4=BE=8B=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E8=84=91=E5=9B=BE=E7=9A=84=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/i18n/case.properties | 8 ++ .../main/resources/i18n/case_en_US.properties | 8 ++ .../main/resources/i18n/case_zh_CN.properties | 8 ++ .../main/resources/i18n/case_zh_TW.properties | 8 ++ .../dto/FunctionalMinderTreeNodeDTO.java | 2 +- .../FunctionalCaseMinderEditRequest.java | 3 +- .../service/FunctionalCaseLogService.java | 10 +- .../service/FunctionalCaseMinderService.java | 135 +++++++++--------- .../service/FunctionalCaseNoticeService.java | 17 +-- .../FunctionalCaseMinderControllerTest.java | 57 ++++---- 10 files changed, 146 insertions(+), 110 deletions(-) diff --git a/backend/framework/sdk/src/main/resources/i18n/case.properties b/backend/framework/sdk/src/main/resources/i18n/case.properties index 6b744b0485..f8a0b09889 100644 --- a/backend/framework/sdk/src/main/resources/i18n/case.properties +++ b/backend/framework/sdk/src/main/resources/i18n/case.properties @@ -93,6 +93,14 @@ minder_extra_node.group_id.length_range=项目ID长度必须在1-50之间 minder_extra_node.group_id.not_blank=项目ID不能为空 minder_extra_node.type.length_range=类型长度必须在1-30之间 minder_extra_node.type.not_blank=类型不能为空 +minder_extra_node.case=用例 +minder_extra_node.module=模块 +minder_extra_node.prerequisite=前置条件 +minder_extra_node.steps=步骤描述 +minder_extra_node.steps_expected_result=预期结果 +minder_extra_node.text_description=文本描述 +minder_extra_node.text_expected_result=预期结果 +minder_extra_node.description=备注信息 #module:CaseReview case_review.id.not_blank=ID不能为空 case_review.name.length_range=名称长度必须在1-200之间 diff --git a/backend/framework/sdk/src/main/resources/i18n/case_en_US.properties b/backend/framework/sdk/src/main/resources/i18n/case_en_US.properties index 4191ac0893..de4c9e34a6 100644 --- a/backend/framework/sdk/src/main/resources/i18n/case_en_US.properties +++ b/backend/framework/sdk/src/main/resources/i18n/case_en_US.properties @@ -129,6 +129,14 @@ minder_extra_node.group_id.length_range=The length of the group ID must be betwe minder_extra_node.group_id.not_blank=Group ID cannot be empty minder_extra_node.type.length_range=The length of the node type must be between 1 and 30 minder_extra_node.type.not_blank=Node type cannot be empty +minder_extra_node.case=Case +minder_extra_node.module=Module +minder_extra_node.prerequisite=Prerequisite +minder_extra_node.steps=Steps +minder_extra_node.steps_expected_result=ExpectedResult +minder_extra_node.text_description=TextDescription +minder_extra_node.text_expected_result=ExpectedResult +minder_extra_node.description=Description #module:CaseReview case_review.id.not_blank=ID cannot be empty case_review.name.length_range=The name length must be between 1 and 200 diff --git a/backend/framework/sdk/src/main/resources/i18n/case_zh_CN.properties b/backend/framework/sdk/src/main/resources/i18n/case_zh_CN.properties index afd17c789c..a1d6bb9bec 100644 --- a/backend/framework/sdk/src/main/resources/i18n/case_zh_CN.properties +++ b/backend/framework/sdk/src/main/resources/i18n/case_zh_CN.properties @@ -128,6 +128,14 @@ minder_extra_node.group_id.length_range=项目ID长度必须在1-50之间 minder_extra_node.group_id.not_blank=项目ID不能为空 minder_extra_node.type.length_range=类型长度必须在1-30之间 minder_extra_node.type.not_blank=类型不能为空 +minder_extra_node.case=用例 +minder_extra_node.module=模块 +minder_extra_node.prerequisite=前置条件 +minder_extra_node.steps=步骤描述 +minder_extra_node.steps_expected_result=预期结果 +minder_extra_node.text_description=文本描述 +minder_extra_node.text_expected_result=预期结果 +minder_extra_node.description=备注信息 #module:CaseReview case_review.id.not_blank=ID不能为空 case_review.name.length_range=名称长度必须在1-200之间 diff --git a/backend/framework/sdk/src/main/resources/i18n/case_zh_TW.properties b/backend/framework/sdk/src/main/resources/i18n/case_zh_TW.properties index 10d3af3f77..192aadb2c3 100644 --- a/backend/framework/sdk/src/main/resources/i18n/case_zh_TW.properties +++ b/backend/framework/sdk/src/main/resources/i18n/case_zh_TW.properties @@ -129,6 +129,14 @@ minder_extra_node.group_id.length_range=項目ID長度必須在1-50之間 minder_extra_node.group_id.not_blank=項目ID不能為空 minder_extra_node.type.length_range=類型長度必須在1-30之間 minder_extra_node.type.not_blank=類型不能為空 +minder_extra_node.case=用例 +minder_extra_node.module=模塊 +minder_extra_node.prerequisite=前置條件 +minder_extra_node.steps=步驟描述 +minder_extra_node.steps_expected_result=預期結果 +minder_extra_node.text_description=文字描述 +minder_extra_node.text_expected_result=預期結果 +minder_extra_node.description=備註資訊 #module:CaseReview case_review.id.not_blank=ID不能為空 case_review.name.length_range=名稱長度必須在1-200之間 diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalMinderTreeNodeDTO.java b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalMinderTreeNodeDTO.java index 178e66f7ae..f7b4aa702c 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalMinderTreeNodeDTO.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalMinderTreeNodeDTO.java @@ -28,7 +28,7 @@ public class FunctionalMinderTreeNodeDTO { @Schema(description = "节点标签") private List resource; - @Schema(description = "节点标签") + @Schema(description = "节点状态") private String expandState = "expand"; } diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/request/FunctionalCaseMinderEditRequest.java b/backend/services/case-management/src/main/java/io/metersphere/functional/request/FunctionalCaseMinderEditRequest.java index 349c71c056..390d264dba 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/request/FunctionalCaseMinderEditRequest.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/request/FunctionalCaseMinderEditRequest.java @@ -1,6 +1,5 @@ package io.metersphere.functional.request; -import io.metersphere.functional.constants.MinderLabel; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Data; @@ -26,7 +25,7 @@ public class FunctionalCaseMinderEditRequest{ private Long pos; @Schema(description = "资源类型") - private MinderLabel type; + private String type; @Schema(description = "用例等级(只更新用例的等级时传)") private String priority; diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseLogService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseLogService.java index ba0677cbc5..83d755cc48 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseLogService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseLogService.java @@ -4,7 +4,6 @@ import io.metersphere.bug.domain.Bug; import io.metersphere.bug.domain.BugRelationCase; import io.metersphere.bug.mapper.BugMapper; import io.metersphere.bug.mapper.BugRelationCaseMapper; -import io.metersphere.functional.constants.MinderLabel; import io.metersphere.functional.domain.*; import io.metersphere.functional.dto.BaseFunctionalCaseBatchDTO; import io.metersphere.functional.dto.FunctionalCaseHistoryLogDTO; @@ -17,6 +16,7 @@ import io.metersphere.project.mapper.FileAssociationMapper; import io.metersphere.sdk.constants.HttpMethodConstants; import io.metersphere.sdk.util.BeanUtils; import io.metersphere.sdk.util.JSON; +import io.metersphere.sdk.util.Translator; import io.metersphere.system.domain.CustomField; import io.metersphere.system.domain.CustomFieldExample; import io.metersphere.system.log.constants.OperationLogModule; @@ -227,12 +227,12 @@ public class FunctionalCaseLogService { String path = "/functional/mind/case/batch/delete/"; List caseAllIds = new ArrayList<>(); Map> resourceMap = resourceList.stream().collect(Collectors.groupingBy(MinderOptionDTO::getType)); - List caseOptionDTOS = resourceMap.get(MinderLabel.CASE.toString()); + List caseOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.case")); if (CollectionUtils.isNotEmpty(caseOptionDTOS)) { List caseIds = caseOptionDTOS.stream().map(MinderOptionDTO::getId).toList(); caseAllIds.addAll(caseIds); } - List moduleOptionDTOS = resourceMap.get(MinderLabel.MODULE.toString()); + List moduleOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.module")); if (CollectionUtils.isNotEmpty(moduleOptionDTOS)) { List moduleIds = moduleOptionDTOS.stream().map(MinderOptionDTO::getId).toList(); List functionalCaseByModuleIds = getFunctionalCaseByModuleIds(moduleIds, new ArrayList<>()); @@ -244,7 +244,7 @@ public class FunctionalCaseLogService { ListlogDTOS = new ArrayList<>(); Listids = new ArrayList<>(); for (String key : strings) { - if (StringUtils.equalsIgnoreCase(key, MinderLabel.CASE.toString()) || StringUtils.equalsIgnoreCase(key, MinderLabel.MODULE.toString())) { + if (StringUtils.equalsIgnoreCase(key, Translator.get("minder_extra_node.case")) || StringUtils.equalsIgnoreCase(key, Translator.get("minder_extra_node.module"))) { List logDTOS1 = batchDeleteFunctionalCaseLogByIds(caseAllIds, path); logDTOS.addAll(logDTOS1); } else { @@ -508,7 +508,7 @@ public class FunctionalCaseLogService { } public LogDTO updateMinderFunctionalCaseLog(FunctionalCaseMinderEditRequest request) { - if (request.getType() == MinderLabel.MODULE) { + if (StringUtils.equalsIgnoreCase(request.getType(), Translator.get("minder_extra_node.module"))) { return null; } FunctionalCaseHistoryLogDTO historyLogDTO = getOriginalValue(request.getId()); diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java index 7e5068de5a..acbf65f4fe 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java @@ -1,7 +1,6 @@ package io.metersphere.functional.service; import io.metersphere.functional.constants.FunctionalCaseTypeConstants; -import io.metersphere.functional.constants.MinderLabel; import io.metersphere.functional.domain.*; import io.metersphere.functional.dto.*; import io.metersphere.functional.mapper.*; @@ -111,7 +110,7 @@ public class FunctionalCaseMinderService { rootData.setText(functionalCaseMindDTO.getName()); rootData.setPriority(functionalCaseMindDTO.getPriority()); rootData.setStatus(functionalCaseMindDTO.getReviewStatus()); - rootData.setResource(List.of(MinderLabel.CASE.toString(), functionalCaseMindDTO.getPriority())); + rootData.setResource(List.of(Translator.get("minder_extra_node.case"))); List children = buildChildren(functionalCaseMindDTO); root.setChildren(children); root.setData(rootData); @@ -124,19 +123,19 @@ public class FunctionalCaseMinderService { List children = new ArrayList<>(); if (functionalCaseMindDTO.getPrerequisite() != null) { String prerequisiteText = new String(functionalCaseMindDTO.getPrerequisite(), StandardCharsets.UTF_8); - FunctionalMinderTreeDTO prerequisiteFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO(prerequisiteText, MinderLabel.PREREQUISITE.toString(), 0L); + FunctionalMinderTreeDTO prerequisiteFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO(prerequisiteText, Translator.get("minder_extra_node.prerequisite"), 0L); children.add(prerequisiteFunctionalMinderTreeDTO); } if (StringUtils.equalsIgnoreCase(functionalCaseMindDTO.getCaseEditType(), FunctionalCaseTypeConstants.CaseEditType.TEXT.name()) && functionalCaseMindDTO.getTextDescription() != null) { String textDescription = new String(functionalCaseMindDTO.getTextDescription(), StandardCharsets.UTF_8); - FunctionalMinderTreeDTO stepFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO(textDescription, MinderLabel.TEXT_DESCRIPTION.toString(), 1L); + FunctionalMinderTreeDTO stepFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO(textDescription, Translator.get("minder_extra_node.text_description"), 1L); if (functionalCaseMindDTO.getExpectedResult() != null) { String expectedResultText = new String(functionalCaseMindDTO.getExpectedResult(), StandardCharsets.UTF_8); - FunctionalMinderTreeDTO expectedResultFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO(expectedResultText, MinderLabel.TEXT_EXPECTED_RESULT.toString(), 1L); + FunctionalMinderTreeDTO expectedResultFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO(expectedResultText, Translator.get("minder_extra_node.text_expected_result"), 1L); stepFunctionalMinderTreeDTO.getChildren().add(expectedResultFunctionalMinderTreeDTO); } else { - FunctionalMinderTreeDTO expectedResultFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO("", MinderLabel.TEXT_EXPECTED_RESULT.toString(), 1L); + FunctionalMinderTreeDTO expectedResultFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO("", Translator.get("minder_extra_node.text_expected_result"), 1L); stepFunctionalMinderTreeDTO.getChildren().add(expectedResultFunctionalMinderTreeDTO); } children.add(stepFunctionalMinderTreeDTO); @@ -148,13 +147,13 @@ public class FunctionalCaseMinderService { List functionalCaseStepDTOS = JSON.parseArray(stepText, FunctionalCaseStepDTO.class); for (FunctionalCaseStepDTO functionalCaseStepDTO : functionalCaseStepDTOS) { i = i + 1; - FunctionalMinderTreeDTO stepFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO(functionalCaseStepDTO.getDesc(), MinderLabel.STEPS.toString(), Long.valueOf(functionalCaseStepDTO.getNum())); + FunctionalMinderTreeDTO stepFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO(functionalCaseStepDTO.getDesc(), Translator.get("minder_extra_node.steps"), Long.valueOf(functionalCaseStepDTO.getNum())); stepFunctionalMinderTreeDTO.getData().setId(functionalCaseStepDTO.getId()); FunctionalMinderTreeDTO expectedResultFunctionalMinderTreeDTO; if (functionalCaseMindDTO.getExpectedResult() != null) { - expectedResultFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO(functionalCaseStepDTO.getResult(), MinderLabel.STEPS_EXPECTED_RESULT.toString(), Long.valueOf(functionalCaseStepDTO.getNum())); + expectedResultFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO(functionalCaseStepDTO.getResult(), Translator.get("minder_extra_node.steps_expected_result"), Long.valueOf(functionalCaseStepDTO.getNum())); } else { - expectedResultFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO("", MinderLabel.STEPS_EXPECTED_RESULT.toString(), Long.valueOf(functionalCaseStepDTO.getNum())); + expectedResultFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO("", Translator.get("minder_extra_node.steps_expected_result"), Long.valueOf(functionalCaseStepDTO.getNum())); } stepFunctionalMinderTreeDTO.getChildren().add(expectedResultFunctionalMinderTreeDTO); children.add(stepFunctionalMinderTreeDTO); @@ -164,7 +163,7 @@ public class FunctionalCaseMinderService { if (functionalCaseMindDTO.getDescription() != null) { String descriptionText = new String(functionalCaseMindDTO.getDescription(), StandardCharsets.UTF_8); - FunctionalMinderTreeDTO descriptionFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO(descriptionText, MinderLabel.DESCRIPTION.toString(), (long) (i + 1)); + FunctionalMinderTreeDTO descriptionFunctionalMinderTreeDTO = getFunctionalMinderTreeDTO(descriptionText, Translator.get("minder_extra_node.description"), (long) (i + 1)); children.add(descriptionFunctionalMinderTreeDTO); } return children; @@ -184,53 +183,55 @@ public class FunctionalCaseMinderService { public void updateFunctionalCase(FunctionalCaseMinderEditRequest request, String userId) { if (StringUtils.isNotBlank(request.getName())) { - switch (request.getType()) { - case CASE -> { - FunctionalCase functionalCase = new FunctionalCase(); - functionalCase.setName(request.getName()); - buildUpdateCaseParam(request.getId(), userId, functionalCase); - functionalCaseMapper.updateByPrimaryKeySelective(functionalCase); - } - case MODULE -> { - FunctionalCaseModule functionalCaseModule = new FunctionalCaseModule(); - functionalCaseModule.setName(request.getName()); - buildUpdateCaseModuleParam(request.getId(), userId, functionalCaseModule); - functionalCaseModuleMapper.updateByPrimaryKeySelective(functionalCaseModule); - } - case PREREQUISITE -> { - FunctionalCaseBlob functionalCaseBlob = new FunctionalCaseBlob(); - functionalCaseBlob.setId(request.getId()); - functionalCaseBlob.setPrerequisite(StringUtils.defaultIfBlank(request.getName(), StringUtils.EMPTY).getBytes(StandardCharsets.UTF_8)); - functionalCaseBlobMapper.updateByPrimaryKeySelective(functionalCaseBlob); - } - case STEPS -> { - FunctionalCaseBlob functionalCaseBlob = functionalCaseBlobMapper.selectByPrimaryKey(request.getId()); - updateSteps(request, functionalCaseBlob); - } - case STEPS_EXPECTED_RESULT -> { - FunctionalCaseBlob functionalCaseBlob = functionalCaseBlobMapper.selectByPrimaryKey(request.getId()); - updateStepResult(request, functionalCaseBlob); - } - case TEXT_DESCRIPTION -> { - FunctionalCaseBlob functionalCaseBlob = new FunctionalCaseBlob(); - functionalCaseBlob.setId(request.getId()); - functionalCaseBlob.setTextDescription(StringUtils.defaultIfBlank(request.getName(), StringUtils.EMPTY).getBytes(StandardCharsets.UTF_8)); - functionalCaseBlobMapper.updateByPrimaryKeySelective(functionalCaseBlob); - } - case TEXT_EXPECTED_RESULT -> { - FunctionalCaseBlob functionalCaseBlob = new FunctionalCaseBlob(); - functionalCaseBlob.setId(request.getId()); - functionalCaseBlob.setExpectedResult(StringUtils.defaultIfBlank(request.getName(), StringUtils.EMPTY).getBytes(StandardCharsets.UTF_8)); - functionalCaseBlobMapper.updateByPrimaryKeySelective(functionalCaseBlob); - } - case DESCRIPTION -> { - FunctionalCaseBlob functionalCaseBlob = new FunctionalCaseBlob(); - functionalCaseBlob.setId(request.getId()); - functionalCaseBlob.setDescription(StringUtils.defaultIfBlank(request.getName(), StringUtils.EMPTY).getBytes(StandardCharsets.UTF_8)); - functionalCaseBlobMapper.updateByPrimaryKeySelective(functionalCaseBlob); - } - default -> { - } + if (StringUtils.equalsIgnoreCase(request.getType(), Translator.get("minder_extra_node.case"))) { + FunctionalCase functionalCase = new FunctionalCase(); + functionalCase.setName(request.getName()); + buildUpdateCaseParam(request.getId(), userId, functionalCase); + functionalCaseMapper.updateByPrimaryKeySelective(functionalCase); + } + if (StringUtils.equalsIgnoreCase(request.getType(), Translator.get("minder_extra_node.module"))) { + FunctionalCaseModule functionalCaseModule = new FunctionalCaseModule(); + functionalCaseModule.setName(request.getName()); + buildUpdateCaseModuleParam(request.getId(), userId, functionalCaseModule); + functionalCaseModuleMapper.updateByPrimaryKeySelective(functionalCaseModule); + } + if (StringUtils.equalsIgnoreCase(request.getType(), Translator.get("minder_extra_node.prerequisite"))) { + FunctionalCaseBlob functionalCaseBlob = new FunctionalCaseBlob(); + functionalCaseBlob.setId(request.getId()); + functionalCaseBlob.setPrerequisite(StringUtils.defaultIfBlank(request.getName(), StringUtils.EMPTY).getBytes(StandardCharsets.UTF_8)); + functionalCaseBlobMapper.updateByPrimaryKeySelective(functionalCaseBlob); + } + if (StringUtils.equalsIgnoreCase(request.getType(), Translator.get("minder_extra_node.steps"))) { + FunctionalCaseBlob functionalCaseBlob = functionalCaseBlobMapper.selectByPrimaryKey(request.getId()); + updateSteps(request, functionalCaseBlob); + } + if (StringUtils.equalsIgnoreCase(request.getType(), Translator.get("minder_extra_node.steps_expected_result"))) { + FunctionalCaseBlob functionalCaseBlob = functionalCaseBlobMapper.selectByPrimaryKey(request.getId()); + updateStepResult(request, functionalCaseBlob); + } + if (StringUtils.equalsIgnoreCase(request.getType(), Translator.get("minder_extra_node.text_description"))) { + FunctionalCaseBlob functionalCaseBlob = new FunctionalCaseBlob(); + functionalCaseBlob.setId(request.getId()); + functionalCaseBlob.setTextDescription(StringUtils.defaultIfBlank(request.getName(), StringUtils.EMPTY).getBytes(StandardCharsets.UTF_8)); + functionalCaseBlobMapper.updateByPrimaryKeySelective(functionalCaseBlob); + } + if (StringUtils.equalsIgnoreCase(request.getType(), Translator.get("minder_extra_node.text_expected_result"))) { + FunctionalCaseBlob functionalCaseBlob = new FunctionalCaseBlob(); + functionalCaseBlob.setId(request.getId()); + functionalCaseBlob.setExpectedResult(StringUtils.defaultIfBlank(request.getName(), StringUtils.EMPTY).getBytes(StandardCharsets.UTF_8)); + functionalCaseBlobMapper.updateByPrimaryKeySelective(functionalCaseBlob); + } + if (StringUtils.equalsIgnoreCase(request.getType(), Translator.get("minder_extra_node.steps_expected_result"))) { + FunctionalCaseBlob functionalCaseBlob = new FunctionalCaseBlob(); + functionalCaseBlob.setId(request.getId()); + functionalCaseBlob.setExpectedResult(StringUtils.defaultIfBlank(request.getName(), StringUtils.EMPTY).getBytes(StandardCharsets.UTF_8)); + functionalCaseBlobMapper.updateByPrimaryKeySelective(functionalCaseBlob); + } + if (StringUtils.equalsIgnoreCase(request.getType(), Translator.get("minder_extra_node.description"))) { + FunctionalCaseBlob functionalCaseBlob = new FunctionalCaseBlob(); + functionalCaseBlob.setId(request.getId()); + functionalCaseBlob.setDescription(StringUtils.defaultIfBlank(request.getName(), StringUtils.EMPTY).getBytes(StandardCharsets.UTF_8)); + functionalCaseBlobMapper.updateByPrimaryKeySelective(functionalCaseBlob); } } if (StringUtils.isNotBlank(request.getPriority())) { @@ -295,11 +296,11 @@ public class FunctionalCaseMinderService { Map> resourceMap = resourceList.stream().collect(Collectors.groupingBy(MinderOptionDTO::getType)); MinderTargetDTO caseMinderTargetDTO = request.getCaseMinderTargetDTO(); MinderTargetDTO moduleMinderTargetDTO = request.getModuleMinderTargetDTO(); - List caseOptionDTOS = resourceMap.get(MinderLabel.CASE.toString()); + List caseOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.case")); List caseIds = new ArrayList<>(); caseIds = checkPermission(caseOptionDTOS, caseIds, FUNCTIONAL_CASE, userId); List moduleIds = new ArrayList<>(); - List moduleOptionDTOS = resourceMap.get(MinderLabel.MODULE.toString()); + List moduleOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.module")); moduleIds = checkPermission(moduleOptionDTOS, moduleIds, FUNCTIONAL_CASE_MODULE, userId); if (StringUtils.isNotBlank(request.getParentTargetId()) ) { //移动到某节点下 @@ -434,7 +435,7 @@ public class FunctionalCaseMinderService { Map> resourceMap = resourceList.stream().collect(Collectors.groupingBy(MinderOptionDTO::getType)); User user = userMapper.selectByPrimaryKey(userId); - List caseOptionDTOS = resourceMap.get(MinderLabel.CASE.toString()); + List caseOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.case")); if (CollectionUtils.isNotEmpty(caseOptionDTOS)) { List caseIds = caseOptionDTOS.stream().map(MinderOptionDTO::getId).toList(); if (!extCheckOwnerMapper.checkoutOwner(FUNCTIONAL_CASE, userId, caseIds)) { @@ -442,7 +443,7 @@ public class FunctionalCaseMinderService { } functionalCaseService.handDeleteFunctionalCase(caseIds, false, userId, projectId); } - List caseModuleOptionDTOS = resourceMap.get(MinderLabel.MODULE.toString()); + List caseModuleOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.module")); if (CollectionUtils.isNotEmpty(caseModuleOptionDTOS)) { List moduleIds = caseModuleOptionDTOS.stream().map(MinderOptionDTO::getId).toList(); if (!extCheckOwnerMapper.checkoutOwner(FUNCTIONAL_CASE_MODULE, userId, moduleIds)) { @@ -451,19 +452,19 @@ public class FunctionalCaseMinderService { List functionalCases = functionalCaseModuleService.deleteModuleByIds(moduleIds, new ArrayList<>(), userId); functionalCaseModuleService.batchDelLog(functionalCases, projectId); } - List prerequisiteOptionDTOS = resourceMap.get(MinderLabel.PREREQUISITE.toString()); + List prerequisiteOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.prerequisite")); updateBlob(userId, "prerequisite", prerequisiteOptionDTOS, projectId, user); - List descriptionOptionDTOS = resourceMap.get(MinderLabel.DESCRIPTION.toString()); + List descriptionOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.description")); updateBlob(userId, "description", descriptionOptionDTOS, projectId, user); - List stepOptionDTOS = resourceMap.get(MinderLabel.STEPS.toString()); + List stepOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.steps")); if (CollectionUtils.isNotEmpty(stepOptionDTOS)) { - List stepResultOptionDTOS = resourceMap.get(MinderLabel.STEPS_EXPECTED_RESULT.toString()); + List stepResultOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.steps_expected_result")); stepOptionDTOS.addAll(stepResultOptionDTOS); updateBlob(userId, "steps", stepOptionDTOS, projectId, user); } - List textOptionDTOS = resourceMap.get(MinderLabel.TEXT_DESCRIPTION.toString()); + List textOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.text_description")); updateBlob(userId, "text_description", textOptionDTOS, projectId, user); - List resultOptionDTOS = resourceMap.get(MinderLabel.TEXT_EXPECTED_RESULT.toString()); + List resultOptionDTOS = resourceMap.get(Translator.get("minder_extra_node.text_expected_result")); updateBlob(userId, "expected_result", resultOptionDTOS, projectId, user); } diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseNoticeService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseNoticeService.java index c28f76d1d4..f00de1cdc4 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseNoticeService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseNoticeService.java @@ -1,6 +1,5 @@ package io.metersphere.functional.service; -import io.metersphere.functional.constants.MinderLabel; import io.metersphere.functional.domain.*; import io.metersphere.functional.dto.CaseCustomFieldDTO; import io.metersphere.functional.dto.FunctionalCaseDTO; @@ -20,6 +19,7 @@ import io.metersphere.plan.mapper.TestPlanFunctionalCaseMapper; import io.metersphere.plan.mapper.TestPlanMapper; import io.metersphere.sdk.util.BeanUtils; import io.metersphere.sdk.util.JSON; +import io.metersphere.sdk.util.Translator; import io.metersphere.system.domain.CustomField; import io.metersphere.system.domain.CustomFieldExample; import io.metersphere.system.domain.User; @@ -147,10 +147,10 @@ public class FunctionalCaseNoticeService { return optionDTOList; } - public FunctionalCaseDTO getAddMainFunctionalCaseDTO(FunctionalCaseAddRequest request, List customFields){ + public FunctionalCaseDTO getAddMainFunctionalCaseDTO(FunctionalCaseAddRequest request, List customFields) { FunctionalCaseEditRequest editRequest = new FunctionalCaseEditRequest(); BeanUtils.copyBean(editRequest, request); - return getMainFunctionalCaseDTO(editRequest,customFields); + return getMainFunctionalCaseDTO(editRequest, customFields); } public FunctionalCaseDTO getMainFunctionalCaseDTO(FunctionalCaseEditRequest request, List customFields) { @@ -226,6 +226,7 @@ public class FunctionalCaseNoticeService { setReviewName(id, functionalCaseDTO); return functionalCaseDTO; } + public Map copyBaseCaseInfo(String projectId, List ids) { FunctionalCaseExample example = new FunctionalCaseExample(); example.createCriteria().andProjectIdEqualTo(projectId).andIdIn(ids); @@ -280,7 +281,7 @@ public class FunctionalCaseNoticeService { functionalCaseDTO.setCreateUser(null); functionalCaseDTO.setFields(optionDTOS.get()); List caseReviewFunctionalCases1 = caseReviewMap.get(id); - ListreviewName = new ArrayList<>(); + List reviewName = new ArrayList<>(); if (CollectionUtils.isNotEmpty(caseReviewFunctionalCases1)) { for (CaseReviewFunctionalCase caseReviewFunctionalCase : caseReviewFunctionalCases1) { String s = finalReviewMap.get(caseReviewFunctionalCase.getReviewId()); @@ -288,7 +289,7 @@ public class FunctionalCaseNoticeService { } } List planFunctionalCases = casePlanMap.get(id); - ListplanName = new ArrayList<>(); + List planName = new ArrayList<>(); if (CollectionUtils.isNotEmpty(planFunctionalCases)) { for (TestPlanFunctionalCase planFunctionalCase : planFunctionalCases) { String s = finalPlanMap.get(planFunctionalCase.getTestPlanId()); @@ -308,9 +309,9 @@ public class FunctionalCaseNoticeService { return dtoList; } - public FunctionalCaseDTO getMainFunctionalCaseMinderDTO(FunctionalCaseMinderEditRequest request) { + public FunctionalCaseDTO getMainFunctionalCaseMinderDTO(FunctionalCaseMinderEditRequest request) { FunctionalCaseDTO functionalCaseDTO = new FunctionalCaseDTO(); - if (request.getType() == MinderLabel.MODULE) { + if (StringUtils.equalsIgnoreCase(request.getType(), Translator.get("minder_extra_node.module"))) { return functionalCaseDTO; } FunctionalCase functionalCase = functionalCaseMapper.selectByPrimaryKey(request.getId()); @@ -335,7 +336,7 @@ public class FunctionalCaseNoticeService { continue; } optionDTO.setId(customField.getName()); - if (StringUtils.equalsIgnoreCase(customField.getId(),field) && StringUtils.isNotBlank(request.getPriority())) { + if (StringUtils.equalsIgnoreCase(customField.getId(), field) && StringUtils.isNotBlank(request.getPriority())) { optionDTO.setName(request.getPriority()); } else { optionDTO.setName(customFieldDTO.getValue()); diff --git a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseMinderControllerTest.java b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseMinderControllerTest.java index f656f6b5b8..3ec04b5476 100644 --- a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseMinderControllerTest.java +++ b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/FunctionalCaseMinderControllerTest.java @@ -1,16 +1,19 @@ package io.metersphere.functional.controller; -import io.metersphere.functional.constants.MinderLabel; import io.metersphere.functional.domain.*; import io.metersphere.functional.dto.FunctionalCaseStepDTO; import io.metersphere.functional.dto.FunctionalMinderTreeDTO; import io.metersphere.functional.dto.MinderOptionDTO; import io.metersphere.functional.dto.MinderTargetDTO; -import io.metersphere.functional.mapper.*; +import io.metersphere.functional.mapper.FunctionalCaseBlobMapper; +import io.metersphere.functional.mapper.FunctionalCaseCustomFieldMapper; +import io.metersphere.functional.mapper.FunctionalCaseMapper; +import io.metersphere.functional.mapper.FunctionalCaseModuleMapper; import io.metersphere.functional.request.FunctionalCaseMindRequest; import io.metersphere.functional.request.FunctionalCaseMinderEditRequest; import io.metersphere.functional.request.FunctionalCaseMinderRemoveRequest; import io.metersphere.sdk.util.JSON; +import io.metersphere.sdk.util.Translator; import io.metersphere.system.base.BaseTest; import io.metersphere.system.controller.handler.ResultHolder; import io.metersphere.system.dto.sdk.enums.MoveTypeEnum; @@ -115,20 +118,20 @@ public class FunctionalCaseMinderControllerTest extends BaseTest { request.setProjectId("project-case-minder-test"); request.setId("TEST_FUNCTIONAL_MINDER_CASE_ID_6"); request.setName("TEST_FUNCTIONAL_MINDER_CASE_ID_Change_Name"); - request.setType(MinderLabel.CASE); + request.setType(Translator.get("minder_extra_node.case")); this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_UPDATE_NAME_URL, request); FunctionalCase functionalCase = functionalCaseMapper.selectByPrimaryKey("TEST_FUNCTIONAL_MINDER_CASE_ID_6"); Assertions.assertEquals(functionalCase.getName(), "TEST_FUNCTIONAL_MINDER_CASE_ID_Change_Name"); request.setName("TEST_MINDER_MODULE_ID_GYQ5_Change_Name"); request.setId("TEST_MINDER_MODULE_ID_GYQ5"); - request.setType(MinderLabel.MODULE); + request.setType(Translator.get("minder_extra_node.module")); this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_UPDATE_NAME_URL, request); FunctionalCaseModule functionalCaseModule = functionalCaseModuleMapper.selectByPrimaryKey("TEST_MINDER_MODULE_ID_GYQ5"); Assertions.assertEquals(functionalCaseModule.getName(), "TEST_MINDER_MODULE_ID_GYQ5_Change_Name"); request.setId("TEST_FUNCTIONAL_MINDER_CASE_ID_6"); request.setName("前置哈哈哈"); - request.setType(MinderLabel.PREREQUISITE); + request.setType(Translator.get("minder_extra_node.prerequisite")); this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_UPDATE_NAME_URL, request); FunctionalCaseBlob functionalCaseBlob = functionalCaseBlobMapper.selectByPrimaryKey("TEST_FUNCTIONAL_MINDER_CASE_ID_6"); Assertions.assertEquals(new String(functionalCaseBlob.getPrerequisite(), StandardCharsets.UTF_8), "前置哈哈哈"); @@ -140,7 +143,7 @@ public class FunctionalCaseMinderControllerTest extends BaseTest { functionalCaseBlobMapper.updateByPrimaryKeySelective(functionalCaseBlobInDB); request.setId("TEST_FUNCTIONAL_MINDER_CASE_ID_6"); request.setName("步骤哈哈哈"); - request.setType(MinderLabel.STEPS); + request.setType(Translator.get("minder_extra_node.steps")); request.setPos(1L); this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_UPDATE_NAME_URL, request); functionalCaseBlob = functionalCaseBlobMapper.selectByPrimaryKey("TEST_FUNCTIONAL_MINDER_CASE_ID_6"); @@ -153,7 +156,7 @@ public class FunctionalCaseMinderControllerTest extends BaseTest { }); request.setId("TEST_FUNCTIONAL_MINDER_CASE_ID_6"); request.setName("步骤结果哈哈哈"); - request.setType(MinderLabel.STEPS_EXPECTED_RESULT); + request.setType(Translator.get("minder_extra_node.steps_expected_result")); request.setPos(1L); this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_UPDATE_NAME_URL, request); functionalCaseBlob = functionalCaseBlobMapper.selectByPrimaryKey("TEST_FUNCTIONAL_MINDER_CASE_ID_6"); @@ -166,17 +169,17 @@ public class FunctionalCaseMinderControllerTest extends BaseTest { }); request.setId("TEST_FUNCTIONAL_MINDER_CASE_ID_6"); request.setName("文本哈哈哈"); - request.setType(MinderLabel.TEXT_DESCRIPTION); + request.setType(Translator.get("minder_extra_node.text_description")); this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_UPDATE_NAME_URL, request); functionalCaseBlob = functionalCaseBlobMapper.selectByPrimaryKey("TEST_FUNCTIONAL_MINDER_CASE_ID_6"); Assertions.assertEquals(new String(functionalCaseBlob.getTextDescription(), StandardCharsets.UTF_8), "文本哈哈哈");request.setId("TEST_FUNCTIONAL_MINDER_CASE_ID_6"); request.setName("预期哈哈哈"); - request.setType(MinderLabel.TEXT_EXPECTED_RESULT); + request.setType(Translator.get("minder_extra_node.text_expected_result")); this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_UPDATE_NAME_URL, request); functionalCaseBlob = functionalCaseBlobMapper.selectByPrimaryKey("TEST_FUNCTIONAL_MINDER_CASE_ID_6"); Assertions.assertEquals(new String(functionalCaseBlob.getExpectedResult(), StandardCharsets.UTF_8), "预期哈哈哈"); request.setName("备注哈哈哈"); - request.setType(MinderLabel.DESCRIPTION); + request.setType(Translator.get("minder_extra_node.description")); this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_UPDATE_NAME_URL, request); functionalCaseBlob = functionalCaseBlobMapper.selectByPrimaryKey("TEST_FUNCTIONAL_MINDER_CASE_ID_6"); Assertions.assertEquals(new String(functionalCaseBlob.getDescription(), StandardCharsets.UTF_8), "备注哈哈哈"); @@ -200,16 +203,16 @@ public class FunctionalCaseMinderControllerTest extends BaseTest { public void testDeleteCase() throws Exception{ List resourceList = new ArrayList<>(); this.requestPost(FUNCTIONAL_CASE_BATCH_DELETE+"/project-case-minder-test", resourceList).andExpect(status().is5xxServerError()); - MinderOptionDTO optionDTO = new MinderOptionDTO("TEST_MINDER_MODULE_ID_GYQ6", MinderLabel.MODULE.name(), 5000L); + MinderOptionDTO optionDTO = new MinderOptionDTO("TEST_MINDER_MODULE_ID_GYQ6", Translator.get("minder_extra_node.module"), 5000L); resourceList.add(optionDTO); this.requestPost(FUNCTIONAL_CASE_BATCH_DELETE+"/project-case-minder-test-xxx", resourceList).andExpect(status().is5xxServerError()); resourceList = new ArrayList<>(); - optionDTO = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_7", MinderLabel.CASE.name(), 1000L); + optionDTO = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_7", Translator.get("minder_extra_node.case"), 1000L); resourceList.add(optionDTO); this.requestPost(FUNCTIONAL_CASE_BATCH_DELETE+"/project-case-minder-test-xxx", resourceList).andExpect(status().is5xxServerError()); resourceList = new ArrayList<>(); - MinderOptionDTO optionDTOCase = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_6", MinderLabel.CASE.name(), 600L); - MinderOptionDTO optionDTOModule = new MinderOptionDTO("TEST_MINDER_MODULE_ID_GYQ", MinderLabel.MODULE.name(), 1200L); + MinderOptionDTO optionDTOCase = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_6", Translator.get("minder_extra_node.case"), 600L); + MinderOptionDTO optionDTOModule = new MinderOptionDTO("TEST_MINDER_MODULE_ID_GYQ", Translator.get("minder_extra_node.module"), 1200L); resourceList.add(optionDTOModule); resourceList.add(optionDTOCase); this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_BATCH_DELETE+"/project-case-minder-test", resourceList); @@ -218,14 +221,14 @@ public class FunctionalCaseMinderControllerTest extends BaseTest { FunctionalCase functionalCaseTwo = functionalCaseMapper.selectByPrimaryKey("TEST_FUNCTIONAL_MINDER_CASE_ID_6"); Assertions.assertTrue(functionalCaseTwo.getDeleted()); resourceList = new ArrayList<>(); - optionDTOCase = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_3", MinderLabel.CASE.name(), 600L); + optionDTOCase = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_3", Translator.get("minder_extra_node.case"), 600L); resourceList.add(optionDTOCase); - MinderOptionDTO optionDTOPrerequisite = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_3", MinderLabel.PREREQUISITE.toString(), 0L); - MinderOptionDTO optionDTODescription = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_3", MinderLabel.DESCRIPTION.toString(), 3L); - MinderOptionDTO optionDTOStep = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_3", MinderLabel.STEPS.toString(), 2L); - MinderOptionDTO optionDTOStepExpectedResult = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_3", MinderLabel.STEPS_EXPECTED_RESULT.toString(), 2L); - MinderOptionDTO optionDTOText = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_3", MinderLabel.TEXT_DESCRIPTION.toString(), 2L); - MinderOptionDTO optionDTOTextExpectedResult = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_3", MinderLabel.TEXT_EXPECTED_RESULT.toString(), 2L); + MinderOptionDTO optionDTOPrerequisite = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_3", Translator.get("minder_extra_node.prerequisite").toString(), 0L); + MinderOptionDTO optionDTODescription = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_3", Translator.get("minder_extra_node.description").toString(), 3L); + MinderOptionDTO optionDTOStep = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_3", Translator.get("minder_extra_node.steps").toString(), 2L); + MinderOptionDTO optionDTOStepExpectedResult = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_3", Translator.get("minder_extra_node.steps_expected_result").toString(), 2L); + MinderOptionDTO optionDTOText = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_3", Translator.get("minder_extra_node.text_description").toString(), 2L); + MinderOptionDTO optionDTOTextExpectedResult = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_3", Translator.get("minder_extra_node.text_expected_result").toString(), 2L); resourceList.add(optionDTOPrerequisite); resourceList.add(optionDTODescription); resourceList.add(optionDTOStep); @@ -234,9 +237,9 @@ public class FunctionalCaseMinderControllerTest extends BaseTest { resourceList.add(optionDTOTextExpectedResult); this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_BATCH_DELETE+"/project-case-minder-test", resourceList); resourceList = new ArrayList<>(); - optionDTOText = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_7", MinderLabel.TEXT_DESCRIPTION.toString(), 2L); + optionDTOText = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_7", Translator.get("minder_extra_node.text_description").toString(), 2L); resourceList.add(optionDTOText); - optionDTOTextExpectedResult = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_7", MinderLabel.TEXT_EXPECTED_RESULT.toString(), 2L); + optionDTOTextExpectedResult = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_7", Translator.get("minder_extra_node.text_expected_result").toString(), 2L); resourceList.add(optionDTOTextExpectedResult); this.requestPost(FUNCTIONAL_CASE_BATCH_DELETE+"/project-case-minder-test", resourceList).andExpect(status().is5xxServerError()); @@ -258,9 +261,9 @@ public class FunctionalCaseMinderControllerTest extends BaseTest { functionalCaseMinderRemoveRequest.setResourceList(new ArrayList<>()); this.requestPost(FUNCTIONAL_CASE_BATCH_MOVE, functionalCaseMinderRemoveRequest).andExpect(status().is5xxServerError()); List resourceList = new ArrayList<>(); - MinderOptionDTO optionDTOCase = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_8", MinderLabel.CASE.name(), 600L); + MinderOptionDTO optionDTOCase = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_8", Translator.get("minder_extra_node.case"), 600L); resourceList.add(optionDTOCase); - MinderOptionDTO optionDTOModule = new MinderOptionDTO("TEST_MINDER_MODULE_ID_GYQ5", MinderLabel.MODULE.name(), 600L); + MinderOptionDTO optionDTOModule = new MinderOptionDTO("TEST_MINDER_MODULE_ID_GYQ5", Translator.get("minder_extra_node.module"), 600L); resourceList.add(optionDTOModule); functionalCaseMinderRemoveRequest.setResourceList(resourceList); this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_BATCH_MOVE, functionalCaseMinderRemoveRequest); @@ -291,10 +294,10 @@ public class FunctionalCaseMinderControllerTest extends BaseTest { functionalCaseMinderRemoveRequest.setParentTargetId("TEST_MINDER_MODULE_ID_GYQ6"); this.requestPost(FUNCTIONAL_CASE_BATCH_MOVE, functionalCaseMinderRemoveRequest).andExpect(status().is5xxServerError()); resourceList = new ArrayList<>(); - optionDTOCase = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_7", MinderLabel.CASE.name(), 600L); + optionDTOCase = new MinderOptionDTO("TEST_FUNCTIONAL_MINDER_CASE_ID_7", Translator.get("minder_extra_node.case"), 600L); resourceList.add(optionDTOCase); this.requestPost(FUNCTIONAL_CASE_BATCH_MOVE, functionalCaseMinderRemoveRequest).andExpect(status().is5xxServerError()); - optionDTOModule = new MinderOptionDTO("TEST_MINDER_MODULE_ID_GYQ6", MinderLabel.MODULE.name(), 600L); + optionDTOModule = new MinderOptionDTO("TEST_MINDER_MODULE_ID_GYQ6", Translator.get("minder_extra_node.module"), 600L); resourceList = new ArrayList<>(); resourceList.add(optionDTOModule); functionalCaseMinderRemoveRequest.setResourceList(resourceList);