From: Kai Moritz Date: Fri, 15 Sep 2023 11:16:37 +0000 (+0200) Subject: WHATTHEFUCK X-Git-Tag: rebase--2023-09-15--16-33~3 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=0a718c7e5d9fb39dbf83eda79610309c55e72600;p=demos%2Fkafka%2Fchat WHATTHEFUCK --- diff --git a/src/test/java/de/juplo/kafka/chat/backend/KafkaConfigurationIT.java b/src/test/java/de/juplo/kafka/chat/backend/KafkaConfigurationIT.java index 724c4816..04caad66 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/KafkaConfigurationIT.java +++ b/src/test/java/de/juplo/kafka/chat/backend/KafkaConfigurationIT.java @@ -65,8 +65,20 @@ class KafkaConfigurationIT extends AbstractConfigurationWithShardingIT @TestConfiguration - @Import(KafkaTestUtils.KafkaTestConfiguration.class) + @EnableConfigurationProperties(ChatBackendProperties.class) + @Import(KafkaServicesConfiguration.class) static class KafkaConfigurationITConfiguration { + @Bean + WorkAssignor dataChannelWorkAssignor(DataChannel dataChannel) + { + return consumer -> + { + List assignedPartitions = + List.of(new TopicPartition(DATA_TOPIC, 2)); + consumer.assign(assignedPartitions); + dataChannel.onPartitionsAssigned(assignedPartitions); + }; + } } } diff --git a/src/test/java/de/juplo/kafka/chat/backend/implementation/kafka/KafkaTestUtils.java b/src/test/java/de/juplo/kafka/chat/backend/implementation/kafka/KafkaTestUtils.java index 4d86848e..e19473b3 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/implementation/kafka/KafkaTestUtils.java +++ b/src/test/java/de/juplo/kafka/chat/backend/implementation/kafka/KafkaTestUtils.java @@ -24,10 +24,10 @@ public class KafkaTestUtils @TestConfiguration @EnableConfigurationProperties(ChatBackendProperties.class) @Import(KafkaServicesConfiguration.class) - public static class KafkaTestConfiguration + static class KafkaTestConfiguration { @Bean - public WorkAssignor dataChannelWorkAssignor(DataChannel dataChannel) + WorkAssignor dataChannelWorkAssignor(DataChannel dataChannel) { return consumer -> { @@ -39,7 +39,7 @@ public class KafkaTestUtils } @Bean - public Clock clock() + Clock clock() { return Clock.systemDefaultZone(); }