Skip to content

Commit

Permalink
Closes Taskana#2521 - Fix code smells use isEmpty() instead of hasSiz…
Browse files Browse the repository at this point in the history
…e(0)
  • Loading branch information
mmenv committed Mar 8, 2024
1 parent cdf0a57 commit 3cc9a02
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ void should_GetLastFourClassifications_When_OffsetIsFifteenAndLimitIsFive() {
void should_GetZeroClassifications_When_OffsetIsNegativeAndLimitIsNegative() {
List<ClassificationSummary> results =
classificationService.createClassificationQuery().domainIn("DOMAIN_A").list(-1, -1);
assertThat(results).hasSize(0);
assertThat(results).isEmpty();
}

@WithAccessId(user = "businessadmin")
@Test
void should_GetZeroClassifications_When_LimitIsNegative() {
List<ClassificationSummary> results =
classificationService.createClassificationQuery().domainIn("DOMAIN_A").list(0, -1);
assertThat(results).hasSize(0);
assertThat(results).isEmpty();
}

@WithAccessId(user = "businessadmin")
@Test
void should_GetZeroClassifications_When_OffsetAndLimitAreZero() {
List<ClassificationSummary> results =
classificationService.createClassificationQuery().domainIn("DOMAIN_A").list(0, 0);
assertThat(results).hasSize(0);
assertThat(results).isEmpty();
}

@WithAccessId(user = "businessadmin")
Expand Down Expand Up @@ -102,15 +102,15 @@ void should_GetAllClassifications_When_UsingPaginationWithPageOneAndPageSizeTwen
void should_GetZeroClassifications_When_UsingPaginationWithSizeZero() {
List<ClassificationSummary> results =
classificationService.createClassificationQuery().domainIn("DOMAIN_A").listPage(1, 0);
assertThat(results).hasSize(0);
assertThat(results).isEmpty();
}

@WithAccessId(user = "businessadmin")
@Test
void should_GetZeroClassifications_When_UsingPaginationWithNegativeSize() {
List<ClassificationSummary> results =
classificationService.createClassificationQuery().domainIn("DOMAIN_A").listPage(1, -1);
assertThat(results).hasSize(0);
assertThat(results).isEmpty();
}

@WithAccessId(user = "businessadmin")
Expand Down

0 comments on commit 3cc9a02

Please sign in to comment.