iliax 1 year ago
parent
commit
a035232213

+ 10 - 10
kafka-ui-api/src/test/java/com/provectus/kafka/ui/emitter/MessagesProcessingTest.java

@@ -33,18 +33,10 @@ class MessagesProcessingTest {
     var shuffled = new ArrayList<>(messagesInOrder);
     Collections.shuffle(shuffled);
 
-    var sortedList = MessagesProcessing.sorted(shuffled, true).toList();
+    var sortedList = MessagesProcessing.sorted(shuffled, true);
     assertThat(sortedList).containsExactlyElementsOf(messagesInOrder);
   }
 
-  private ConsumerRecord<Bytes, Bytes> consumerRecord(int partition, long offset, String ts) {
-    return new ConsumerRecord<>(
-        "topic", partition, offset, OffsetDateTime.parse(ts).toInstant().toEpochMilli(),
-        TimestampType.CREATE_TIME,
-        0, 0, null, null, new RecordHeaders(), Optional.empty()
-    );
-  }
-
   @RepeatedTest(5)
   void testSortingDesc() {
     var messagesInOrder = List.of(
@@ -62,8 +54,16 @@ class MessagesProcessingTest {
     var shuffled = new ArrayList<>(messagesInOrder);
     Collections.shuffle(shuffled);
 
-    var sortedList = MessagesProcessing.sorted(shuffled, false).toList();
+    var sortedList = MessagesProcessing.sorted(shuffled, false);
     assertThat(sortedList).containsExactlyElementsOf(messagesInOrder);
   }
 
+  private ConsumerRecord<Bytes, Bytes> consumerRecord(int partition, long offset, String ts) {
+    return new ConsumerRecord<>(
+        "topic", partition, offset, OffsetDateTime.parse(ts).toInstant().toEpochMilli(),
+        TimestampType.CREATE_TIME,
+        0, 0, null, null, new RecordHeaders(), Optional.empty()
+    );
+  }
+
 }