diff --git a/streams/src/test/java/org/apache/kafka/streams/integration/OptimizedKTableIntegrationTest.java b/streams/src/test/java/org/apache/kafka/streams/integration/OptimizedKTableIntegrationTest.java index ea24090b0bd6b..fbf40e2835e97 100644 --- a/streams/src/test/java/org/apache/kafka/streams/integration/OptimizedKTableIntegrationTest.java +++ b/streams/src/test/java/org/apache/kafka/streams/integration/OptimizedKTableIntegrationTest.java @@ -22,7 +22,6 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; -import static org.junit.Assert.assertTrue; import java.time.Duration; import java.util.ArrayList; @@ -46,7 +45,6 @@ import org.apache.kafka.streams.KeyQueryMetadata; import org.apache.kafka.streams.integration.utils.EmbeddedKafkaCluster; import org.apache.kafka.streams.integration.utils.IntegrationTestUtils; -import org.apache.kafka.streams.integration.utils.IntegrationTestUtils.TrackingStateRestoreListener; import org.apache.kafka.streams.kstream.Consumed; import org.apache.kafka.streams.kstream.Materialized; import org.apache.kafka.streams.state.KeyValueStore; @@ -107,9 +105,7 @@ public void shouldApplyUpdatesToStandbyStore() throws Exception { final KafkaStreams kafkaStreams1 = createKafkaStreams(builder, streamsConfiguration()); final KafkaStreams kafkaStreams2 = createKafkaStreams(builder, streamsConfiguration()); final List kafkaStreamsList = Arrays.asList(kafkaStreams1, kafkaStreams2); - final TrackingStateRestoreListener listener = new TrackingStateRestoreListener(); - kafkaStreamsList.forEach(kafkaStreams -> kafkaStreams.setGlobalStateRestoreListener(listener)); startApplicationAndWaitUntilRunning(kafkaStreamsList, Duration.ofSeconds(60)); produceValueRange(key, 0, batch1NumMessages); @@ -131,11 +127,6 @@ public void shouldApplyUpdatesToStandbyStore() throws Exception { kafkaStreams1WasFirstActive = false; } - // Assert that no restore has occurred, ensures that when we check later that the restore - // notification actually came from after the rebalance. - assertTrue(listener.allStartOffsetsAtZero()); - assertThat(listener.totalNumRestored(), is(equalTo(0L))); - // Assert that the current value in store reflects all messages being processed assertThat(kafkaStreams1WasFirstActive ? store1.get(key) : store2.get(key), is(equalTo(batch1NumMessages - 1)));