Skip to content

Commit

Permalink
Remove compiler warnings in ConcurrentMessageListenerContainerTests (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sobychacko authored Aug 27, 2024
1 parent 29146ba commit bceeebf
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1019,8 +1019,8 @@ protected Consumer<Integer, String> createKafkaConsumer(String groupId, String c

container.start();

MessageListenerContainer childContainer0 = container.getContainers().get(0);
MessageListenerContainer childContainer1 = container.getContainers().get(1);
KafkaMessageListenerContainer<Integer, String> childContainer0 = container.getContainers().get(0);
KafkaMessageListenerContainer<Integer, String> childContainer1 = container.getContainers().get(1);

ContainerTestUtils.waitForAssignment(container, embeddedKafka.getPartitionsPerTopic());
assertThat(container.getAssignedPartitions()).hasSize(2);
Expand Down Expand Up @@ -1062,9 +1062,9 @@ protected Consumer<Integer, String> createKafkaConsumer(String groupId, String c
assertThat(childContainer1.isRunning()).isTrue();
assertThat(childContainer0.isRunning()).isFalse();
assertThat(container.getContainers()).
contains((KafkaMessageListenerContainer<Integer, String>) childContainer0);
contains(childContainer0);
assertThat(container.getContainers()).
contains((KafkaMessageListenerContainer<Integer, String>) childContainer1);
contains(childContainer1);

container.stop();

Expand All @@ -1076,16 +1076,16 @@ protected Consumer<Integer, String> createKafkaConsumer(String groupId, String c
assertThat(concurrentContainerStopLatch.await(30, TimeUnit.SECONDS)).isTrue();

assertThat(container.getContainers()).
doesNotContain((KafkaMessageListenerContainer<Integer, String>) childContainer0);
doesNotContain(childContainer0);
assertThat(container.getContainers()).
doesNotContain((KafkaMessageListenerContainer<Integer, String>) childContainer1);
doesNotContain(childContainer1);

// Accept this start
container.start();
assertThat(container.getContainers()).
doesNotContain((KafkaMessageListenerContainer<Integer, String>) childContainer0);
doesNotContain(childContainer0);
assertThat(container.getContainers()).
doesNotContain((KafkaMessageListenerContainer<Integer, String>) childContainer1);
doesNotContain(childContainer1);

container.getContainers().forEach(containerForEach -> containerForEach.stop());
assertThat(container.getContainers()).isNotEmpty();
Expand Down

0 comments on commit bceeebf

Please sign in to comment.