refactor(测试计划): 优化报告分享部分接口
This commit is contained in:
parent
d7a675faf4
commit
7cc472529c
|
@ -6,7 +6,10 @@ import io.metersphere.bug.dto.response.BugDTO;
|
|||
import io.metersphere.plan.constants.TestPlanResourceConfig;
|
||||
import io.metersphere.plan.domain.TestPlanReport;
|
||||
import io.metersphere.plan.dto.ReportDetailCasePageDTO;
|
||||
import io.metersphere.plan.dto.request.*;
|
||||
import io.metersphere.plan.dto.request.TestPlanReportBatchRequest;
|
||||
import io.metersphere.plan.dto.request.TestPlanReportDetailEditRequest;
|
||||
import io.metersphere.plan.dto.request.TestPlanReportGenRequest;
|
||||
import io.metersphere.plan.dto.request.TestPlanReportPageRequest;
|
||||
import io.metersphere.plan.dto.response.TestPlanReportDetailResponse;
|
||||
import io.metersphere.plan.dto.response.TestPlanReportPageResponse;
|
||||
import io.metersphere.plan.service.TestPlanManagementService;
|
||||
|
@ -14,6 +17,7 @@ import io.metersphere.plan.service.TestPlanReportLogService;
|
|||
import io.metersphere.plan.service.TestPlanReportNoticeService;
|
||||
import io.metersphere.plan.service.TestPlanReportService;
|
||||
import io.metersphere.sdk.constants.PermissionConstants;
|
||||
import io.metersphere.system.dto.sdk.BasePageRequest;
|
||||
import io.metersphere.system.log.annotation.Log;
|
||||
import io.metersphere.system.log.constants.OperationLogType;
|
||||
import io.metersphere.system.notice.annotation.SendNotice;
|
||||
|
@ -91,15 +95,15 @@ public class TestPlanReportController {
|
|||
|
||||
// 报告详情开始
|
||||
|
||||
@GetMapping("/get/{id}")
|
||||
@GetMapping("/get/{reportId}")
|
||||
@Operation(summary = "测试计划-报告-详情")
|
||||
@RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ)
|
||||
@CheckOwner(resourceId = "#id", resourceType = "test_plan_report")
|
||||
public TestPlanReportDetailResponse get(@PathVariable String id) {
|
||||
return testPlanReportService.getReport(id);
|
||||
@CheckOwner(resourceId = "#reportId", resourceType = "test_plan_report")
|
||||
public TestPlanReportDetailResponse get(@PathVariable String reportId) {
|
||||
return testPlanReportService.getReport(reportId);
|
||||
}
|
||||
|
||||
@PostMapping("/edit")
|
||||
@PostMapping("/detail/edit")
|
||||
@Operation(summary = "测试计划-报告-详情-报告内容更新")
|
||||
@RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ_UPDATE)
|
||||
@CheckOwner(resourceId = "#request.getId()", resourceType = "test_plan_report")
|
||||
|
@ -107,23 +111,25 @@ public class TestPlanReportController {
|
|||
return testPlanReportService.edit(request);
|
||||
}
|
||||
|
||||
@PostMapping("/detail/bug/page")
|
||||
@PostMapping("/detail/bug/page/{reportId}")
|
||||
@Operation(summary = "测试计划-报告-详情-缺陷分页查询")
|
||||
@RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ)
|
||||
@CheckOwner(resourceId = "#request.getReportId()", resourceType = "test_plan_report")
|
||||
public Pager<List<BugDTO>> pageBug(@Validated @RequestBody TestPlanReportDetailPageRequest request) {
|
||||
@CheckOwner(resourceId = "#reportId", resourceType = "test_plan_report")
|
||||
public Pager<List<BugDTO>> pageBug(@PathVariable String reportId,
|
||||
@Validated @RequestBody BasePageRequest request) {
|
||||
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
|
||||
StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tprb.bug_num, tprb.id desc");
|
||||
return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailBugs(request));
|
||||
return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailBugs(request, reportId));
|
||||
}
|
||||
|
||||
@PostMapping("/detail/functional/case/page")
|
||||
@PostMapping("/detail/functional/case/page/{reportId}")
|
||||
@Operation(summary = "测试计划-报告-详情-功能用例分页查询")
|
||||
@RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ)
|
||||
@CheckOwner(resourceId = "#request.getReportId()", resourceType = "test_plan_report")
|
||||
public Pager<List<ReportDetailCasePageDTO>> pageFunctionalCase(@Validated @RequestBody TestPlanReportDetailPageRequest request) {
|
||||
@CheckOwner(resourceId = "#reportId", resourceType = "test_plan_report")
|
||||
public Pager<List<ReportDetailCasePageDTO>> pageFunctionalCase(@PathVariable String reportId,
|
||||
@Validated @RequestBody BasePageRequest request) {
|
||||
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
|
||||
StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tprfc.function_case_num, tprfc.id desc");
|
||||
return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailFunctionalCases(request));
|
||||
return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailFunctionalCases(request, reportId));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,39 @@
|
|||
package io.metersphere.plan.controller;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.metersphere.bug.dto.response.BugDTO;
|
||||
import io.metersphere.plan.dto.ReportDetailCasePageDTO;
|
||||
import io.metersphere.plan.dto.TestPlanShareInfo;
|
||||
import io.metersphere.plan.dto.request.TestPlanReportShareRequest;
|
||||
import io.metersphere.plan.dto.response.TestPlanReportDetailResponse;
|
||||
import io.metersphere.plan.dto.response.TestPlanShareResponse;
|
||||
import io.metersphere.plan.service.TestPlanReportService;
|
||||
import io.metersphere.plan.service.TestPlanReportShareService;
|
||||
import io.metersphere.sdk.constants.PermissionConstants;
|
||||
import io.metersphere.sdk.domain.ShareInfo;
|
||||
import io.metersphere.system.dto.sdk.BasePageRequest;
|
||||
import io.metersphere.system.security.CheckOwner;
|
||||
import io.metersphere.system.utils.PageUtils;
|
||||
import io.metersphere.system.utils.Pager;
|
||||
import io.metersphere.system.utils.SessionUtils;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/test-plan/report/share")
|
||||
@Tag(name = "测试计划-分享")
|
||||
public class TestPlanReportShareController {
|
||||
|
||||
@Resource
|
||||
private TestPlanReportService testPlanReportService;
|
||||
@Resource
|
||||
private TestPlanReportShareService testPlanReportShareService;
|
||||
|
||||
|
@ -30,14 +46,52 @@ public class TestPlanReportShareController {
|
|||
}
|
||||
|
||||
@GetMapping("/get/{id}")
|
||||
@Operation(summary = "接口测试-接口报告-获取分享链接")
|
||||
@Operation(summary = "测试计划-报告-获取分享链接")
|
||||
public TestPlanShareResponse get(@PathVariable String id) {
|
||||
return testPlanReportShareService.get(id);
|
||||
}
|
||||
|
||||
@GetMapping("/get-share-time/{id}")
|
||||
@Operation(summary = "接口测试-接口报告-获取分享链接的有效时间")
|
||||
@Operation(summary = "测试计划-报告-获取分享链接的有效时间")
|
||||
public String getShareTime(@PathVariable String id) {
|
||||
return testPlanReportShareService.getShareTime(id);
|
||||
}
|
||||
|
||||
// 分享报告详情开始
|
||||
|
||||
@GetMapping("/get/{shareId}/{reportId}")
|
||||
@Operation(summary = "测试计划-报告分享-详情查看")
|
||||
@RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ)
|
||||
@CheckOwner(resourceId = "#id", resourceType = "test_plan_report")
|
||||
public TestPlanReportDetailResponse getDetail(@PathVariable String shareId, @PathVariable String reportId) {
|
||||
ShareInfo shareInfo = testPlanReportShareService.checkResource(shareId);
|
||||
testPlanReportShareService.validateExpired(shareInfo);
|
||||
return testPlanReportService.getReport(reportId);
|
||||
}
|
||||
|
||||
@PostMapping("/detail/bug/page/{shareId}/{reportId}")
|
||||
@Operation(summary = "测试计划-报告-详情-缺陷分页查询")
|
||||
@RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ)
|
||||
@CheckOwner(resourceId = "#reportId", resourceType = "test_plan_report")
|
||||
public Pager<List<BugDTO>> pageBug(@PathVariable String reportId, @PathVariable String shareId,
|
||||
@Validated @RequestBody BasePageRequest request) {
|
||||
ShareInfo shareInfo = testPlanReportShareService.checkResource(shareId);
|
||||
testPlanReportShareService.validateExpired(shareInfo);
|
||||
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
|
||||
StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tprb.bug_num, tprb.id desc");
|
||||
return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailBugs(request, reportId));
|
||||
}
|
||||
|
||||
@PostMapping("/detail/functional/case/page/{shareId}/{reportId}")
|
||||
@Operation(summary = "测试计划-报告-详情-功能用例分页查询")
|
||||
@RequiresPermissions(PermissionConstants.TEST_PLAN_REPORT_READ)
|
||||
@CheckOwner(resourceId = "#reportId", resourceType = "test_plan_report")
|
||||
public Pager<List<ReportDetailCasePageDTO>> pageFunctionalCase(@PathVariable String reportId, @PathVariable String shareId,
|
||||
@Validated @RequestBody BasePageRequest request) {
|
||||
ShareInfo shareInfo = testPlanReportShareService.checkResource(shareId);
|
||||
testPlanReportShareService.validateExpired(shareInfo);
|
||||
Page<Object> page = PageHelper.startPage(request.getCurrent(), request.getPageSize(),
|
||||
StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "tprfc.function_case_num, tprfc.id desc");
|
||||
return PageUtils.setPageInfo(page, testPlanReportService.listReportDetailFunctionalCases(request, reportId));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import io.metersphere.sdk.util.DateUtils;
|
|||
import io.metersphere.sdk.util.SubListUtils;
|
||||
import io.metersphere.sdk.util.Translator;
|
||||
import io.metersphere.system.domain.User;
|
||||
import io.metersphere.system.dto.sdk.BasePageRequest;
|
||||
import io.metersphere.system.mapper.UserMapper;
|
||||
import io.metersphere.system.notice.constants.NoticeConstants;
|
||||
import io.metersphere.system.service.UserService;
|
||||
|
@ -364,8 +365,11 @@ public class TestPlanReportService {
|
|||
* @param request 请求参数
|
||||
* @return 缺陷分页数据
|
||||
*/
|
||||
public List<BugDTO> listReportDetailBugs(TestPlanReportDetailPageRequest request) {
|
||||
return extTestPlanReportBugMapper.list(request);
|
||||
public List<BugDTO> listReportDetailBugs(BasePageRequest request, String reportId) {
|
||||
TestPlanReportDetailPageRequest reportRequest = new TestPlanReportDetailPageRequest();
|
||||
BeanUtils.copyBean(reportRequest, request);
|
||||
reportRequest.setReportId(reportId);
|
||||
return extTestPlanReportBugMapper.list(reportRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -373,8 +377,11 @@ public class TestPlanReportService {
|
|||
* @param request 请求参数
|
||||
* @return 缺陷分页数据
|
||||
*/
|
||||
public List<ReportDetailCasePageDTO> listReportDetailFunctionalCases(TestPlanReportDetailPageRequest request) {
|
||||
return extTestPlanReportFunctionalCaseMapper.list(request);
|
||||
public List<ReportDetailCasePageDTO> listReportDetailFunctionalCases(BasePageRequest request, String reportId) {
|
||||
TestPlanReportDetailPageRequest reportRequest = new TestPlanReportDetailPageRequest();
|
||||
BeanUtils.copyBean(reportRequest, request);
|
||||
reportRequest.setReportId(reportId);
|
||||
return extTestPlanReportFunctionalCaseMapper.list(reportRequest);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import io.metersphere.project.domain.ProjectApplicationExample;
|
|||
import io.metersphere.project.mapper.ProjectApplicationMapper;
|
||||
import io.metersphere.sdk.constants.ShareInfoType;
|
||||
import io.metersphere.sdk.domain.ShareInfo;
|
||||
import io.metersphere.sdk.exception.MSException;
|
||||
import io.metersphere.sdk.mapper.ShareInfoMapper;
|
||||
import io.metersphere.sdk.util.BeanUtils;
|
||||
import io.metersphere.sdk.util.Translator;
|
||||
|
@ -18,11 +19,17 @@ import io.metersphere.system.mapper.BaseUserMapper;
|
|||
import io.metersphere.system.uid.IDGenerator;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static io.metersphere.sdk.util.ShareUtil.getTimeMills;
|
||||
|
||||
@Service
|
||||
public class TestPlanReportShareService {
|
||||
|
||||
|
@ -35,6 +42,33 @@ public class TestPlanReportShareService {
|
|||
@Resource
|
||||
private ProjectApplicationMapper projectApplicationMapper;
|
||||
|
||||
private static final Long DEFAULT = 1000L * 60 * 60 * 24;
|
||||
|
||||
@Transactional(propagation = Propagation.NOT_SUPPORTED)
|
||||
public void validateExpired(ShareInfo shareInfo) {
|
||||
String shareType = shareInfo.getShareType();
|
||||
String projectId = "";
|
||||
if (StringUtils.equals(shareType, ShareInfoType.TEST_PLAN_SHARE_REPORT.name())) {
|
||||
TestPlanReport planReport = testPlanReportMapper.selectByPrimaryKey(new String(shareInfo.getCustomData()));
|
||||
if (planReport != null && BooleanUtils.isFalse(planReport.getDeleted())) {
|
||||
projectId = planReport.getProjectId();
|
||||
}
|
||||
}
|
||||
if (StringUtils.isBlank(projectId)) {
|
||||
throw new MSException(Translator.get("test_plan_report_not_exist"));
|
||||
}
|
||||
ProjectApplicationExample example = new ProjectApplicationExample();
|
||||
example.createCriteria().andProjectIdEqualTo(projectId).andTypeEqualTo(shareType);
|
||||
List<ProjectApplication> projectApplications = projectApplicationMapper.selectByExample(example);
|
||||
if (CollectionUtils.isEmpty(projectApplications)) {
|
||||
millisCheck(System.currentTimeMillis() - shareInfo.getUpdateTime(), DEFAULT, shareInfo.getId());
|
||||
} else {
|
||||
String expr = projectApplications.getFirst().getTypeValue();
|
||||
long timeMills = getTimeMills(shareInfo.getUpdateTime(), expr);
|
||||
millisCheck(System.currentTimeMillis(), timeMills, shareInfo.getId());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成计划报告分享信息
|
||||
* @param shareRequest 分享请求参数
|
||||
|
@ -94,7 +128,7 @@ public class TestPlanReportShareService {
|
|||
* @param id 分享ID
|
||||
* @return 分享资源信息
|
||||
*/
|
||||
private ShareInfo checkResource(String id) {
|
||||
public ShareInfo checkResource(String id) {
|
||||
ShareInfo shareInfo = shareInfoMapper.selectByPrimaryKey(id);
|
||||
if (shareInfo == null) {
|
||||
throw new RuntimeException(Translator.get("connection_expired"));
|
||||
|
@ -130,4 +164,17 @@ public class TestPlanReportShareService {
|
|||
}
|
||||
return testPlanShareInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验时间是否过期
|
||||
* @param compareMillis 比较时间
|
||||
* @param millis 分享时间
|
||||
* @param shareInfoId 分享ID
|
||||
*/
|
||||
private void millisCheck(long compareMillis, long millis, String shareInfoId) {
|
||||
if (compareMillis > millis) {
|
||||
shareInfoMapper.deleteByPrimaryKey(shareInfoId);
|
||||
throw new MSException(Translator.get("connection_expired"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,12 +10,15 @@ import io.metersphere.plan.mapper.TestPlanReportMapper;
|
|||
import io.metersphere.plan.mapper.TestPlanReportSummaryMapper;
|
||||
import io.metersphere.plan.service.CleanupTestPlanReportServiceImpl;
|
||||
import io.metersphere.plan.service.TestPlanReportService;
|
||||
import io.metersphere.project.domain.ProjectApplicationExample;
|
||||
import io.metersphere.project.mapper.ProjectApplicationMapper;
|
||||
import io.metersphere.sdk.constants.ProjectApplicationType;
|
||||
import io.metersphere.sdk.constants.ShareInfoType;
|
||||
import io.metersphere.sdk.util.CommonBeanFactory;
|
||||
import io.metersphere.sdk.util.JSON;
|
||||
import io.metersphere.system.base.BaseTest;
|
||||
import io.metersphere.system.controller.handler.ResultHolder;
|
||||
import io.metersphere.system.dto.sdk.BasePageRequest;
|
||||
import io.metersphere.system.utils.Pager;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
@ -46,18 +49,25 @@ public class TestPlanReportControllerTests extends BaseTest {
|
|||
private static final String BATCH_DELETE_PLAN_REPORT = "/test-plan/report/batch-delete";
|
||||
private static final String GEN_PLAN_REPORT = "/test-plan/report/gen";
|
||||
private static final String GET_PLAN_REPORT = "/test-plan/report/get";
|
||||
private static final String EDIT_PLAN_REPORT = "/test-plan/report/edit";
|
||||
private static final String EDIT_PLAN_REPORT = "/test-plan/report/detail/edit";
|
||||
private static final String GET_PLAN_REPORT_DETAIL_BUG_PAGE = "/test-plan/report/detail/bug/page";
|
||||
private static final String GET_PLAN_REPORT_DETAIL_FUNCTIONAL_PAGE = "/test-plan/report/detail/functional/case/page";
|
||||
private static final String GEN_AND_SHARE = "/test-plan/report/share/gen";
|
||||
private static final String GET_SHARE_INFO = "/test-plan/report/share/get";
|
||||
private static final String GET_SHARE_TIME = "/test-plan/report/share/get-share-time";
|
||||
private static final String GET_SHARE_REPORT = "/test-plan/report/share/get";
|
||||
private static final String GET_SHARE_REPORT_BUG_LIST = "/test-plan/report/share/detail/bug/page";
|
||||
private static final String GET_SHARE_REPORT_FUNCTIONAL_LIST = "/test-plan/report/share/detail/functional/case/page";
|
||||
|
||||
@Autowired
|
||||
private TestPlanReportMapper testPlanReportMapper;
|
||||
@Resource
|
||||
private TestPlanReportService testPlanReportService;
|
||||
@Resource
|
||||
private ProjectApplicationMapper projectApplicationMapper;
|
||||
|
||||
private static String GEN_REPORT_ID;
|
||||
private static String GEN_SHARE_ID;
|
||||
|
||||
@Test
|
||||
@Order(1)
|
||||
|
@ -140,6 +150,7 @@ public class TestPlanReportControllerTests extends BaseTest {
|
|||
TestPlanShareInfo shareInfo = JSON.parseObject(JSON.toJSONString(sortHolder.getData()), TestPlanShareInfo.class);
|
||||
Assertions.assertNotNull(shareInfo);
|
||||
this.requestGet(GET_SHARE_INFO + "/" + shareInfo.getId());
|
||||
GEN_SHARE_ID = shareInfo.getId();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -160,6 +171,36 @@ public class TestPlanReportControllerTests extends BaseTest {
|
|||
|
||||
@Test
|
||||
@Order(8)
|
||||
void testGetShareReportTableList() throws Exception{
|
||||
BasePageRequest request = new BasePageRequest();
|
||||
request.setCurrent(1);
|
||||
request.setPageSize(10);
|
||||
// 获取分享的报告的列表明细
|
||||
this.requestPostWithOk(GET_SHARE_REPORT_BUG_LIST + "/" + GEN_SHARE_ID + "/test-plan-report-id-1", request);
|
||||
this.requestPostWithOk(GET_SHARE_REPORT_FUNCTIONAL_LIST + "/" + GEN_SHARE_ID + "/test-plan-report-id-1", request);
|
||||
request.setSort(Map.of("num", "asc"));
|
||||
this.requestPostWithOk(GET_SHARE_REPORT_BUG_LIST + "/" + GEN_SHARE_ID + "/test-plan-report-id-1", request);
|
||||
this.requestPostWithOk(GET_SHARE_REPORT_FUNCTIONAL_LIST + "/" + GEN_SHARE_ID + "/test-plan-report-id-1", request);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(9)
|
||||
void testGetShareReport() throws Exception{
|
||||
// 获取分享的报告
|
||||
this.requestGet(GET_SHARE_REPORT + "/" + GEN_SHARE_ID + "/test-plan-report-id-1");
|
||||
ProjectApplicationExample example = new ProjectApplicationExample();
|
||||
example.createCriteria().andProjectIdEqualTo("100001100001").andTypeEqualTo("TEST_PLAN_SHARE_REPORT");
|
||||
projectApplicationMapper.deleteByExample(example);
|
||||
this.requestGet(GET_SHARE_REPORT + "/" + GEN_SHARE_ID + "/test-plan-report-id-1");
|
||||
TestPlanReport report = new TestPlanReport();
|
||||
report.setId("test-plan-report-id-1");
|
||||
report.setDeleted(true);
|
||||
testPlanReportMapper.updateByPrimaryKeySelective(report);
|
||||
this.requestGet(GET_SHARE_REPORT + "/" + GEN_SHARE_ID + "/test-plan-report-id-1");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(10)
|
||||
void testDeletePlanReport() throws Exception {
|
||||
TestPlanReportDeleteRequest request = new TestPlanReportDeleteRequest();
|
||||
request.setId("test-plan-report-id-1");
|
||||
|
@ -168,7 +209,7 @@ public class TestPlanReportControllerTests extends BaseTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Order(9)
|
||||
@Order(11)
|
||||
void testBatchDeletePlanReport() throws Exception {
|
||||
TestPlanReportBatchRequest request = new TestPlanReportBatchRequest();
|
||||
request.setProjectId("100001100001");
|
||||
|
@ -186,7 +227,7 @@ public class TestPlanReportControllerTests extends BaseTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Order(10)
|
||||
@Order(12)
|
||||
@Sql(scripts = {"/dml/init_test_plan_report_gen.sql"}, config = @SqlConfig(encoding = "utf-8", transactionMode = SqlConfig.TransactionMode.ISOLATED))
|
||||
void testGenReportError() throws Exception {
|
||||
TestPlanReportGenRequest genRequest = new TestPlanReportGenRequest();
|
||||
|
@ -196,7 +237,7 @@ public class TestPlanReportControllerTests extends BaseTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Order(11)
|
||||
@Order(13)
|
||||
void testGenReportSuccess() throws Exception {
|
||||
TestPlanReportGenRequest genRequest = new TestPlanReportGenRequest();
|
||||
genRequest.setProjectId("100001100001");
|
||||
|
@ -213,37 +254,35 @@ public class TestPlanReportControllerTests extends BaseTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Order(12)
|
||||
@Order(14)
|
||||
void testGetReportSuccess() throws Exception {
|
||||
this.requestGet(GET_PLAN_REPORT + "/" + GEN_REPORT_ID);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(13)
|
||||
void testPageReportDetailBugSuccess() throws Exception {
|
||||
TestPlanReportDetailPageRequest request = new TestPlanReportDetailPageRequest();
|
||||
request.setReportId(GEN_REPORT_ID);
|
||||
request.setCurrent(1);
|
||||
request.setPageSize(10);
|
||||
this.requestPostWithOk(GET_PLAN_REPORT_DETAIL_BUG_PAGE, request);
|
||||
request.setSort(Map.of("num", "asc"));
|
||||
this.requestPostWithOk(GET_PLAN_REPORT_DETAIL_BUG_PAGE, request);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(14)
|
||||
void testPageReportDetailFunctionalCaseSuccess() throws Exception {
|
||||
TestPlanReportDetailPageRequest request = new TestPlanReportDetailPageRequest();
|
||||
request.setReportId(GEN_REPORT_ID);
|
||||
request.setCurrent(1);
|
||||
request.setPageSize(10);
|
||||
this.requestPostWithOk(GET_PLAN_REPORT_DETAIL_FUNCTIONAL_PAGE, request);
|
||||
request.setSort(Map.of("num", "asc"));
|
||||
this.requestPostWithOk(GET_PLAN_REPORT_DETAIL_FUNCTIONAL_PAGE, request);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(15)
|
||||
void testPageReportDetailBugSuccess() throws Exception {
|
||||
BasePageRequest request = new BasePageRequest();
|
||||
request.setCurrent(1);
|
||||
request.setPageSize(10);
|
||||
this.requestPostWithOk(GET_PLAN_REPORT_DETAIL_BUG_PAGE + "/" + GEN_REPORT_ID, request);
|
||||
request.setSort(Map.of("num", "asc"));
|
||||
this.requestPostWithOk(GET_PLAN_REPORT_DETAIL_BUG_PAGE + "/" + GEN_REPORT_ID, request);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(16)
|
||||
void testPageReportDetailFunctionalCaseSuccess() throws Exception {
|
||||
BasePageRequest request = new BasePageRequest();
|
||||
request.setCurrent(1);
|
||||
request.setPageSize(10);
|
||||
this.requestPostWithOk(GET_PLAN_REPORT_DETAIL_FUNCTIONAL_PAGE + "/" + GEN_REPORT_ID, request);
|
||||
request.setSort(Map.of("num", "asc"));
|
||||
this.requestPostWithOk(GET_PLAN_REPORT_DETAIL_FUNCTIONAL_PAGE + "/" + GEN_REPORT_ID, request);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(17)
|
||||
void testEditReportDetail() throws Exception {
|
||||
TestPlanReportDetailEditRequest request = new TestPlanReportDetailEditRequest();
|
||||
request.setId(GEN_REPORT_ID);
|
||||
|
|
Loading…
Reference in New Issue