wip
This commit is contained in:
parent
94c460447e
commit
a035232213
1 changed files with 10 additions and 10 deletions
|
@ -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()
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue