diff --git a/integration-tests/src/integrationTest/java/pl/allegro/tech/hermes/integrationtests/KafkaRetransmissionServiceTest.java b/integration-tests/src/integrationTest/java/pl/allegro/tech/hermes/integrationtests/KafkaRetransmissionServiceTest.java index e17e410b0c..9c6f47cc43 100644 --- a/integration-tests/src/integrationTest/java/pl/allegro/tech/hermes/integrationtests/KafkaRetransmissionServiceTest.java +++ b/integration-tests/src/integrationTest/java/pl/allegro/tech/hermes/integrationtests/KafkaRetransmissionServiceTest.java @@ -90,19 +90,20 @@ public void shouldMoveOffsetNearGivenTimestamp(boolean suspendedSubscription) .retransmit( topic.getQualifiedName(), subscription.getName(), retransmissionDate, false); - if (suspendedSubscription) { - hermes.api().activateSubscription(topic, subscription.getName()); - hermes.api().waitUntilSubscriptionActivated(topic.getQualifiedName(), subscription.getName()); - } - // then - response.expectStatus().isOk(); // Check if Kafka committed offsets were moved on retransmission assertThat( hermes .api() .calculateCommittedMessages(topic.getQualifiedName(), subscription.getName())) .isLessThan(commitedMessages); + response.expectStatus().isOk(); + + if (suspendedSubscription) { + hermes.api().activateSubscription(topic, subscription.getName()); + hermes.api().waitUntilSubscriptionActivated(topic.getQualifiedName(), subscription.getName()); + } + messages2.forEach(subscriber::waitUntilReceived); hermes.api().waitUntilConsumerCommitsOffset(topic.getQualifiedName(), subscription.getName()); assertThat(