Skip to content

Commit

Permalink
feat: case count limit (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
QizhengMo authored Jan 3, 2024
1 parent c2bc9c6 commit e16195f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class BuildReplayPlanRequest {
*/
private Integer caseSourceType;

private int caseCountLimit;
private Integer caseCountLimit;

/**
* yyyy-MM-dd HH:mm:ss
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public ReplayPlan build(BuildReplayPlanRequest request, PlanContext planContext)
if (schedule != null) {
replayPlan.setReplaySendMaxQps(schedule.getSendMaxQps());
}
if (request.getCaseCountLimit() <= 0) {
if (request.getCaseCountLimit() == null || request.getCaseCountLimit() <= 0) {
replayPlan.setCaseCountLimit(OPERATION_MAX_CASE_COUNT);
} else {
replayPlan.setCaseCountLimit(request.getCaseCountLimit());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public CommonResponse createPlanGet(@RequestParam(name = "appId") String appId,
@RequestParam(name = "targetEnv") String targetEnv,
@RequestParam(name = "caseSourceFrom", required = false) Long caseSourceFrom,
@RequestParam(name = "caseSourceTo", required = false) Long caseSourceTo,
@RequestParam(name = "caseCountLimit", required = false) Integer caseCountLimit,
@RequestParam(name = "planName", required = false) String planName,
@RequestParam(name = "operationIds", required = false) List<String> operationIds
) {
Expand All @@ -74,6 +75,7 @@ public CommonResponse createPlanGet(@RequestParam(name = "appId") String appId,
req.setReplayPlanType(BuildReplayPlanType.BY_APP_ID.getValue());
req.setOperator("Webhook");
req.setPlanName(planName);
req.setCaseCountLimit(caseCountLimit);

// date
Date dateFrom = Optional.ofNullable(caseSourceFrom).map(Date::new)
Expand Down

0 comments on commit e16195f

Please sign in to comment.