diff --git a/cluster-api/src/main/java/io/aiven/klaw/clusterapi/models/enums/TopicContentType.java b/cluster-api/src/main/java/io/aiven/klaw/clusterapi/models/enums/TopicContentType.java index 6c33b747d7..fab09544b0 100644 --- a/cluster-api/src/main/java/io/aiven/klaw/clusterapi/models/enums/TopicContentType.java +++ b/cluster-api/src/main/java/io/aiven/klaw/clusterapi/models/enums/TopicContentType.java @@ -4,14 +4,12 @@ @Getter public enum TopicContentType { + CUSTOM("custom"), + RANGE("range"); - CUSTOM("custom"), - RANGE("range"); - - private final String value; - - TopicContentType(String value) { - this.value = value; - } + private final String value; + TopicContentType(String value) { + this.value = value; + } } diff --git a/cluster-api/src/main/java/io/aiven/klaw/clusterapi/services/TopicContentsService.java b/cluster-api/src/main/java/io/aiven/klaw/clusterapi/services/TopicContentsService.java index 07774e945b..66cd09608d 100644 --- a/cluster-api/src/main/java/io/aiven/klaw/clusterapi/services/TopicContentsService.java +++ b/cluster-api/src/main/java/io/aiven/klaw/clusterapi/services/TopicContentsService.java @@ -64,7 +64,8 @@ public Map readEvents( Map eventMap = new TreeMap<>(); KafkaConsumer consumer; - if (offsetPosition.equals(TopicContentType.RANGE.getValue()) && (rangeOffsetsStart < 0 || rangeOffsetsEnd < 0)) { + if (offsetPosition.equals(TopicContentType.RANGE.getValue()) + && (rangeOffsetsStart < 0 || rangeOffsetsEnd < 0)) { return eventMap; } @@ -95,7 +96,8 @@ public Map readEvents( } if (partitionsAssignment.isEmpty() - || (offsetPosition.equals(TopicContentType.RANGE.getValue()) && rangeOffsetsStart > rangeOffsetsEnd)) { + || (offsetPosition.equals(TopicContentType.RANGE.getValue()) + && rangeOffsetsStart > rangeOffsetsEnd)) { consumer.close(); return eventMap; } diff --git a/cluster-api/src/test/java/io/aiven/klaw/clusterapi/TopicContentsControllerIT.java b/cluster-api/src/test/java/io/aiven/klaw/clusterapi/TopicContentsControllerIT.java index bca83ee877..590dfdcd27 100644 --- a/cluster-api/src/test/java/io/aiven/klaw/clusterapi/TopicContentsControllerIT.java +++ b/cluster-api/src/test/java/io/aiven/klaw/clusterapi/TopicContentsControllerIT.java @@ -168,8 +168,7 @@ void getTopicContentsWhenRangeAndEndOffsetNegative() throws Exception { @Test @Order(10) void getTopicContentsWhenRangeAndStartAndEndOffsetNegative() throws Exception { - String url = - createUrl(RANGE_SELECTION, Integer.MAX_VALUE, -1, -1); + String url = createUrl(RANGE_SELECTION, Integer.MAX_VALUE, -1, -1); Map response = getTopicContentsPerformMockRequest(url); @@ -190,8 +189,7 @@ void getTopicContentsWhenRangeAndStartOffsetBiggerThanEndOffset() throws Excepti @Order(12) void getTopicContentsWhenRangeAndStartAndEndOffsetEqual() throws Exception { int start = 5; - String url = - createUrl(RANGE_SELECTION, Integer.MAX_VALUE, start, start); + String url = createUrl(RANGE_SELECTION, Integer.MAX_VALUE, start, start); Map response = getTopicContentsPerformMockRequest(url);