fix(测试计划): 修复删除最后一个标签更新失败的缺陷

This commit is contained in:
wxg0103 2024-06-20 11:36:58 +08:00 committed by Craftsman
parent 9985e02d3d
commit 7d31cc3e20
3 changed files with 9 additions and 1 deletions

View File

@ -836,7 +836,7 @@ public class BugControllerTests extends BaseTest {
handleUserField.setId("assignee");
handleUserField.setName("处理人");
handleUserField.setType("select");
handleUserField.setValue("60f68f7952162b0068de6a2d");
handleUserField.setValue("5f44bb528d89e300469effed");
BugCustomFieldDTO statusField = new BugCustomFieldDTO();
statusField.setId("status");
statusField.setName("状态");

View File

@ -367,6 +367,8 @@ public class TestPlanService extends TestPlanBaseUtilsService {
}
if (CollectionUtils.isNotEmpty(request.getTags())) {
updateTestPlan.setTags(new ArrayList<>(request.getTags()));
} else {
updateTestPlan.setTags(new ArrayList<>());
}
updateTestPlan.setPlannedStartTime(request.getPlannedStartTime());
updateTestPlan.setPlannedEndTime(request.getPlannedEndTime());

View File

@ -1108,6 +1108,8 @@ public class TestPlanTests extends BaseTest {
//修改标签
updateRequest = testPlanTestService.generateUpdateRequest(testPlan.getId());
updateRequest.setTags(new LinkedHashSet<>());
this.requestPostWithOkAndReturn(URL_POST_TEST_PLAN_UPDATE, updateRequest);
updateRequest.setTags(new LinkedHashSet<>(Arrays.asList("tag1", "tag2", "tag3", "tag3")));
mvcResult = this.requestPostWithOkAndReturn(URL_POST_TEST_PLAN_UPDATE, updateRequest);
returnStr = mvcResult.getResponse().getContentAsString();
@ -1121,6 +1123,7 @@ public class TestPlanTests extends BaseTest {
updateRequest = testPlanTestService.generateUpdateRequest(testPlan.getId());
updateRequest.setPlannedStartTime(System.currentTimeMillis());
updateRequest.setPlannedEndTime(updateRequest.getPlannedStartTime() - 10000);
updateRequest.setTags(new LinkedHashSet<>(testPlan.getTags()));
mvcResult = this.requestPostWithOkAndReturn(URL_POST_TEST_PLAN_UPDATE, updateRequest);
returnStr = mvcResult.getResponse().getContentAsString();
holder = JSON.parseObject(returnStr, ResultHolder.class);
@ -1132,6 +1135,7 @@ public class TestPlanTests extends BaseTest {
//修改描述
updateRequest = testPlanTestService.generateUpdateRequest(testPlan.getId());
updateRequest.setDescription("This is desc");
updateRequest.setTags(new LinkedHashSet<>(testPlan.getTags()));
mvcResult = this.requestPostWithOkAndReturn(URL_POST_TEST_PLAN_UPDATE, updateRequest);
returnStr = mvcResult.getResponse().getContentAsString();
holder = JSON.parseObject(returnStr, ResultHolder.class);
@ -1145,6 +1149,7 @@ public class TestPlanTests extends BaseTest {
updateRequest.setAutomaticStatusUpdate(true);
updateRequest.setRepeatCase(true);
updateRequest.setPassThreshold(43.12);
updateRequest.setTags(new LinkedHashSet<>(testPlan.getTags()));
mvcResult = this.requestPostWithOkAndReturn(URL_POST_TEST_PLAN_UPDATE, updateRequest);
returnStr = mvcResult.getResponse().getContentAsString();
holder = JSON.parseObject(returnStr, ResultHolder.class);
@ -1156,6 +1161,7 @@ public class TestPlanTests extends BaseTest {
updateRequest.setAutomaticStatusUpdate(false);
updateRequest.setRepeatCase(false);
updateRequest.setPassThreshold(56.47);
updateRequest.setTags(new LinkedHashSet<>(testPlan.getTags()));
mvcResult = this.requestPostWithOkAndReturn(URL_POST_TEST_PLAN_UPDATE, updateRequest);
returnStr = mvcResult.getResponse().getContentAsString();
holder = JSON.parseObject(returnStr, ResultHolder.class);