WHATTHEFUCK
authorKai Moritz <kai@juplo.de>
Fri, 15 Sep 2023 11:16:37 +0000 (13:16 +0200)
committerKai Moritz <kai@juplo.de>
Fri, 15 Sep 2023 11:17:55 +0000 (13:17 +0200)
src/test/java/de/juplo/kafka/chat/backend/KafkaConfigurationIT.java
src/test/java/de/juplo/kafka/chat/backend/implementation/kafka/KafkaTestUtils.java

index 724c481..04caad6 100644 (file)
@@ -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<TopicPartition> assignedPartitions =
+            List.of(new TopicPartition(DATA_TOPIC, 2));
+        consumer.assign(assignedPartitions);
+        dataChannel.onPartitionsAssigned(assignedPartitions);
+      };
+    }
   }
 }
index 4d86848..e19473b 100644 (file)
@@ -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();
     }