Skip to content

Commit

Permalink
perf: 定时任务详情数据加载方式优化 #3284
Browse files Browse the repository at this point in the history
1.修复单元测试。
  • Loading branch information
jsonwan committed Nov 14, 2024
1 parent c9ea0d8 commit 17a6294
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
Expand Down Expand Up @@ -419,16 +421,18 @@ void listCronJobByCondition() {
assertThat(cronJobInfoPageData.getStart()).isEqualTo(0);
assertThat(cronJobInfoPageData.getPageSize()).isEqualTo(2);
assertThat(cronJobInfoPageData.getTotal()).isEqualTo(4);
assertThat(cronJobInfoPageData.getData()).contains(CRON_JOB_5);
assertThat(cronJobInfoPageData.getData()).contains(CRON_JOB_1);
Set<Long> ids = cronJobInfoPageData.getData().stream().map(CronJobInfoDTO::getId).collect(Collectors.toSet());
assertThat(ids).contains(CRON_JOB_5.getId());
assertThat(ids).contains(CRON_JOB_1.getId());

baseSearchCondition.setStart(2);
cronJobInfoPageData = cronJobDAO.listPageCronJobsWithoutVarsByCondition(cronJobCondition, baseSearchCondition);
assertThat(cronJobInfoPageData.getStart()).isEqualTo(2);
assertThat(cronJobInfoPageData.getPageSize()).isEqualTo(2);
assertThat(cronJobInfoPageData.getTotal()).isEqualTo(4);
assertThat(cronJobInfoPageData.getData()).contains(CRON_JOB_9);
assertThat(cronJobInfoPageData.getData()).contains(CRON_JOB_3);
ids = cronJobInfoPageData.getData().stream().map(CronJobInfoDTO::getId).collect(Collectors.toSet());
assertThat(ids).contains(CRON_JOB_9.getId());
assertThat(ids).contains(CRON_JOB_3.getId());
System.out.println(cronJobInfoPageData.getData());
baseSearchCondition.setStart(0);

Expand All @@ -437,8 +441,9 @@ void listCronJobByCondition() {
assertThat(cronJobInfoPageData.getStart()).isEqualTo(0);
assertThat(cronJobInfoPageData.getPageSize()).isEqualTo(2);
assertThat(cronJobInfoPageData.getTotal()).isEqualTo(4);
assertThat(cronJobInfoPageData.getData()).contains(CRON_JOB_9);
assertThat(cronJobInfoPageData.getData()).contains(CRON_JOB_3);
ids = cronJobInfoPageData.getData().stream().map(CronJobInfoDTO::getId).collect(Collectors.toSet());
assertThat(ids).contains(CRON_JOB_9.getId());
assertThat(ids).contains(CRON_JOB_3.getId());
System.out.println(cronJobInfoPageData.getData());
baseSearchCondition.setOrder(0);
}
Expand Down

0 comments on commit 17a6294

Please sign in to comment.