Skip to content

Commit

Permalink
Fix flaky test due to unordered data structure(#781)
Browse files Browse the repository at this point in the history
Fixed test Update MemoryRetainedRepositoryTest.java  which used as ordered an a collection of Topic names which are unordered.
  • Loading branch information
dserfe authored Oct 22, 2023
1 parent bfe4ff9 commit 79053a3
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import io.netty.handler.codec.mqtt.MqttQoS;
import org.junit.jupiter.api.Test;

import java.util.Comparator;
import java.util.List;

import static org.junit.jupiter.api.Assertions.*;
Expand Down Expand Up @@ -82,6 +83,7 @@ public void testRetainedOnTopicReturnsWildcardTopicMatch() {
assertEquals("foo/bar/baz", retainedMessages.get(0).getTopic().toString());

retainedMessages = repository.retainedOnTopic("foo/#");
retainedMessages.sort(Comparator.comparing(m -> m.getTopic().toString()));

assertEquals(2, retainedMessages.size());
assertEquals("foo/bar/baz", retainedMessages.get(0).getTopic().toString());
Expand Down

0 comments on commit 79053a3

Please sign in to comment.