Skip to content

Commit

Permalink
provectus#518 Fixed backend page size (provectus#523)
Browse files Browse the repository at this point in the history
* provectus#518 Fixed backend page size

* Fixedd tests
  • Loading branch information
germanosin committed Jun 3, 2021
1 parent 52a367d commit caa6fb5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
@Service
@RequiredArgsConstructor
public class ClusterService {
private static final Integer DEFAULT_PAGE_SIZE = 20;
private static final Integer DEFAULT_PAGE_SIZE = 25;

private final ClustersStorage clustersStorage;
private final ClusterMapper clusterMapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ClusterServiceTest {
private ClustersStorage clustersStorage;

@Test
public void shouldListFirst20Topics() {
public void shouldListFirst25Topics() {
var topicName = UUID.randomUUID().toString();

when(clustersStorage.getClusterByName(topicName))
Expand All @@ -51,8 +51,8 @@ public void shouldListFirst20Topics() {
var topics = clusterService.getTopics(topicName,
Optional.empty(), Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty());
assertThat(topics.getPageCount()).isEqualTo(5);
assertThat(topics.getTopics()).hasSize(20);
assertThat(topics.getPageCount()).isEqualTo(4);
assertThat(topics.getTopics()).hasSize(25);
assertThat(topics.getTopics()).map(Topic::getName).isSorted();
}

Expand Down Expand Up @@ -97,8 +97,8 @@ public void shouldCorrectlyHandleNonPositivePageNumberAndPageSize() {

var topics = clusterService.getTopics(topicName, Optional.of(0), Optional.of(-1),
Optional.empty(), Optional.empty(), Optional.empty());
assertThat(topics.getPageCount()).isEqualTo(5);
assertThat(topics.getTopics()).hasSize(20);
assertThat(topics.getPageCount()).isEqualTo(4);
assertThat(topics.getTopics()).hasSize(25);
assertThat(topics.getTopics()).map(Topic::getName).isSorted();
}

Expand All @@ -122,8 +122,8 @@ public void shouldListBotInternalAndNonInternalTopics() {
var topics = clusterService.getTopics(topicName,
Optional.empty(), Optional.empty(), Optional.of(true),
Optional.empty(), Optional.empty());
assertThat(topics.getPageCount()).isEqualTo(5);
assertThat(topics.getTopics()).hasSize(20);
assertThat(topics.getPageCount()).isEqualTo(4);
assertThat(topics.getTopics()).hasSize(25);
assertThat(topics.getTopics()).map(Topic::getName).isSorted();
}

Expand All @@ -148,8 +148,8 @@ public void shouldListOnlyNonInternalTopics() {
var topics = clusterService.getTopics(topicName,
Optional.empty(), Optional.empty(), Optional.of(true),
Optional.empty(), Optional.empty());
assertThat(topics.getPageCount()).isEqualTo(5);
assertThat(topics.getTopics()).hasSize(20);
assertThat(topics.getPageCount()).isEqualTo(4);
assertThat(topics.getTopics()).hasSize(25);
assertThat(topics.getTopics()).map(Topic::getName).isSorted();
}

Expand Down Expand Up @@ -198,8 +198,8 @@ public void shouldListTopicsOrderedByPartitionsCount() {
var topics = clusterService.getTopics(topicName,
Optional.empty(), Optional.empty(), Optional.empty(),
Optional.empty(), Optional.of(TopicColumnsToSort.TOTAL_PARTITIONS));
assertThat(topics.getPageCount()).isEqualTo(5);
assertThat(topics.getTopics()).hasSize(20);
assertThat(topics.getPageCount()).isEqualTo(4);
assertThat(topics.getTopics()).hasSize(25);
assertThat(topics.getTopics()).map(Topic::getPartitionCount).isSorted();
}
}

0 comments on commit caa6fb5

Please sign in to comment.