fix(用例管理): 修复用例评审复制评审失败问题

--bug=1036219 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036219
This commit is contained in:
guoyuqi 2024-02-23 18:54:35 +08:00 committed by 刘瑞斌
parent 7a453643ad
commit 342cde7dbf
2 changed files with 16 additions and 1 deletions

View File

@ -238,7 +238,11 @@ public class CaseReviewService {
List<String> caseIds = caseReviewFunctionalCases.stream().map(CaseReviewFunctionalCase::getCaseId).distinct().toList();
CaseReview caseReview = addCaseReview(request, userId, caseReviewId, caseIds);
BaseAssociateCaseRequest baseAssociateCaseRequest = request.getBaseAssociateCaseRequest();
addAssociate(request, userId, caseReviewId, caseIds, baseAssociateCaseRequest.getReviewers());
if (baseAssociateCaseRequest != null) {
addAssociate(request, userId, caseReviewId, caseIds, baseAssociateCaseRequest.getReviewers());
} else {
addAssociate(request, userId, caseReviewId, caseIds, request.getReviewers());
}
return caseReview;
}

View File

@ -108,6 +108,17 @@ public class CaseReviewControllerTests extends BaseTest {
List<String> list = caseReviews.stream().map(CaseReview::getId).distinct().toList();
Assertions.assertEquals(2, list.size());
caseReviewCopyRequest = getCaseReviewAddRequest("创建评审1", CaseReviewPassRule.SINGLE.toString(), "CASE_REVIEW_TEST_GYQ_ID", false, true, null);
caseReviewCopyRequest.setCopyId(caseReviewId);
caseReviewCopyRequest.setBaseAssociateCaseRequest(null);
mvcResult1 = this.requestPostWithOkAndReturn(COPY_CASE_REVIEW, caseReviewCopyRequest);
caseReview1 = getResultData(mvcResult1, CaseReview.class);
checkLog(caseReview1.getId(), OperationLogType.COPY);
caseReviews = getCaseReviews("创建评审1");
Assertions.assertEquals(3, caseReviews.size());
list = caseReviews.stream().map(CaseReview::getId).distinct().toList();
Assertions.assertEquals(3, list.size());
caseReviewRequest = getCaseReviewAddRequest("创建评审X", CaseReviewPassRule.SINGLE.toString(), "CASE_REVIEW_TEST_GYQ_ID", false, true, null);
BaseAssociateCaseRequest baseAssociateCaseRequest = caseReviewRequest.getBaseAssociateCaseRequest();
baseAssociateCaseRequest.setSelectAll(true);