diff --git a/src/test/java/reactor/kafka/receiver/internals/MockReceiverTest.java b/src/test/java/reactor/kafka/receiver/internals/MockReceiverTest.java index 525cab01..fbb0d6d0 100644 --- a/src/test/java/reactor/kafka/receiver/internals/MockReceiverTest.java +++ b/src/test/java/reactor/kafka/receiver/internals/MockReceiverTest.java @@ -70,6 +70,7 @@ import java.util.function.Function; import java.util.regex.Pattern; +import static org.assertj.core.api.Assertions.assertThat; import static org.awaitility.Awaitility.await; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -1188,7 +1189,8 @@ public void consumerMethods() throws Exception { testConsumerMethod(c -> { Collection partitions = Collections.singleton(new TopicPartition(topic, 1)); c.pause(partitions); - assertEquals(partitions, c.paused()); + // Due to backpressure other partitions can be paused at the same moment in time + assertThat(c.paused()).containsAll(partitions); c.resume(partitions); }); testConsumerMethod(c -> {