fix(功能用例): 脑图文本节点名称不能为空
This commit is contained in:
parent
501c5b44a5
commit
0e964a9443
|
@ -101,6 +101,7 @@ minder_extra_node.steps_expected_result=预期结果
|
|||
minder_extra_node.text_description=文本描述
|
||||
minder_extra_node.text_expected_result=预期结果
|
||||
minder_extra_node.description=备注信息
|
||||
minder_extra_node.text_node_empty=文本节点名称不能为空
|
||||
#module:CaseReview
|
||||
case_review.id.not_blank=ID不能为空
|
||||
case_review.name.length_range=名称长度必须在1-200之间
|
||||
|
|
|
@ -137,6 +137,7 @@ 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
|
||||
minder_extra_node.text_node_empty=Text node name cannot be empty
|
||||
#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
|
||||
|
|
|
@ -136,6 +136,7 @@ minder_extra_node.steps_expected_result=预期结果
|
|||
minder_extra_node.text_description=文本描述
|
||||
minder_extra_node.text_expected_result=预期结果
|
||||
minder_extra_node.description=备注信息
|
||||
minder_extra_node.text_node_empty=文本节点名称不能为空
|
||||
#module:CaseReview
|
||||
case_review.id.not_blank=ID不能为空
|
||||
case_review.name.length_range=名称长度必须在1-200之间
|
||||
|
|
|
@ -137,6 +137,7 @@ minder_extra_node.steps_expected_result=預期結果
|
|||
minder_extra_node.text_description=文字描述
|
||||
minder_extra_node.text_expected_result=預期結果
|
||||
minder_extra_node.description=備註資訊
|
||||
minder_extra_node.text_node_empty=文字節點名稱不能為空
|
||||
#module:CaseReview
|
||||
case_review.id.not_blank=ID不能為空
|
||||
case_review.name.length_range=名稱長度必須在1-200之間
|
||||
|
|
|
@ -738,6 +738,9 @@ public class FunctionalCaseMinderService {
|
|||
if (mindAdditionalNodeRequest.getName().length()>255) {
|
||||
mindAdditionalNodeRequest.setName(mindAdditionalNodeRequest.getName().substring(0,249));
|
||||
}
|
||||
if (StringUtils.isBlank(mindAdditionalNodeRequest.getName())) {
|
||||
throw new MSException(Translator.get("minder_extra_node.text_node_empty"));
|
||||
}
|
||||
mindAdditionalNode.setName(mindAdditionalNodeRequest.getName());
|
||||
mindAdditionalNode.setParentId(mindAdditionalNodeRequest.getParentId());
|
||||
mindAdditionalNode.setUpdateTime(System.currentTimeMillis());
|
||||
|
@ -753,6 +756,9 @@ public class FunctionalCaseMinderService {
|
|||
if (mindAdditionalNodeRequest.getName().length()>255) {
|
||||
mindAdditionalNodeRequest.setName(mindAdditionalNodeRequest.getName().substring(0,249));
|
||||
}
|
||||
if (StringUtils.isBlank(mindAdditionalNodeRequest.getName())) {
|
||||
throw new MSException(Translator.get("minder_extra_node.text_node_empty"));
|
||||
}
|
||||
mindAdditionalNode.setName(mindAdditionalNodeRequest.getName());
|
||||
mindAdditionalNode.setParentId(mindAdditionalNodeRequest.getParentId());
|
||||
mindAdditionalNode.setProjectId(request.getProjectId());
|
||||
|
|
|
@ -24,6 +24,8 @@ import java.nio.charset.StandardCharsets;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
@AutoConfigureMockMvc
|
||||
|
@ -329,6 +331,27 @@ public class FunctionalCaseMinderControllerTest extends BaseTest {
|
|||
this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_EDIT_URL, request);
|
||||
functionalCases = functionalCaseMapper.selectByExample(functionalCaseExample);
|
||||
Assertions.assertTrue(CollectionUtils.isNotEmpty(functionalCases));
|
||||
|
||||
mindAdditionalNodeRequest = new MindAdditionalNodeRequest();
|
||||
mindAdditionalNodeRequest.setId("sss2");
|
||||
mindAdditionalNodeRequest.setType("ADD");
|
||||
mindAdditionalNodeRequest.setName("");
|
||||
mindAdditionalNodeRequest.setParentId("TEST_MINDER_MODULE_ID_GYQ");
|
||||
additionalNodeList.add(mindAdditionalNodeRequest);
|
||||
request.setAdditionalNodeList(additionalNodeList);
|
||||
|
||||
this.requestPost(FUNCTIONAL_CASE_EDIT_URL, request).andExpect(status().is5xxServerError());
|
||||
request.getAdditionalNodeList().remove(additionalNodeList.size()-1);
|
||||
mindAdditionalNodeRequest = new MindAdditionalNodeRequest();
|
||||
mindAdditionalNodeRequest.setId("additional2");
|
||||
mindAdditionalNodeRequest.setType("UPDATE");
|
||||
mindAdditionalNodeRequest.setName("");
|
||||
mindAdditionalNodeRequest.setParentId("TEST_MINDER_MODULE_ID_GYQ");
|
||||
additionalNodeList.add(mindAdditionalNodeRequest);
|
||||
request.setAdditionalNodeList(additionalNodeList);
|
||||
|
||||
this.requestPost(FUNCTIONAL_CASE_EDIT_URL, request).andExpect(status().is5xxServerError());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue