From 0a718c7e5d9fb39dbf83eda79610309c55e72600 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 15 Sep 2023 13:16:37 +0200 Subject: [PATCH] WHATTHEFUCK --- .../kafka/chat/backend/KafkaConfigurationIT.java | 14 +++++++++++++- .../implementation/kafka/KafkaTestUtils.java | 6 +++--- 2 files changed, 16 insertions(+), 4 deletions(-) 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(); } -- 2.20.1