WIP
authorKai Moritz <kai@juplo.de>
Wed, 13 Sep 2023 20:39:53 +0000 (22:39 +0200)
committerKai Moritz <kai@juplo.de>
Wed, 13 Sep 2023 20:39:53 +0000 (22:39 +0200)
src/test/java/de/juplo/kafka/chat/backend/implementation/kafka/KafkaChatHomeServiceTest.java

index 6e6fcb1..204b34e 100644 (file)
@@ -76,20 +76,13 @@ public class KafkaChatHomeServiceTest extends ChatHomeServiceWithShardsTest
 
 
   @BeforeAll
-  public static void sendAndLoadStoredData(
-      @Autowired
-      KafkaTemplate<String, String> messageTemplate,
-      @Autowired
-      KafkaServicesApplicationRunner applicationRunner)
-      throws Exception
+  public static void sendAndLoadStoredData(@Autowired KafkaTemplate<String, String> messageTemplate)
   {
     send(messageTemplate, "5c73531c-6fc4-426c-adcb-afc5c140a0f7","{ \"id\": \"5c73531c-6fc4-426c-adcb-afc5c140a0f7\", \"shard\": 2, \"name\": \"FOO\" }", "command_create_chatroom");
     send(messageTemplate,"5c73531c-6fc4-426c-adcb-afc5c140a0f7","{ \"id\" : 1, \"user\" : \"peter\", \"text\" : \"Hallo, ich heiße Peter!\" }", "event_chatmessage_received");
     send(messageTemplate,"5c73531c-6fc4-426c-adcb-afc5c140a0f7","{ \"id\" : 1, \"user\" : \"ute\", \"text\" : \"Ich bin Ute...\" }", "event_chatmessage_received");
     send(messageTemplate,"5c73531c-6fc4-426c-adcb-afc5c140a0f7","{ \"id\" : 2, \"user\" : \"peter\", \"text\" : \"Willst du mit mir gehen?\" }", "event_chatmessage_received");
     send(messageTemplate,"5c73531c-6fc4-426c-adcb-afc5c140a0f7","{ \"id\" : 1, \"user\" : \"klaus\", \"text\" : \"Ja? Nein? Vielleicht??\" }", "event_chatmessage_received");
-
-    applicationRunner.run(new DefaultApplicationArguments());
   }
 
   static void send(KafkaTemplate<String, String> kafkaTemplate, String key, String value, String typeId)
@@ -105,9 +98,7 @@ public class KafkaChatHomeServiceTest extends ChatHomeServiceWithShardsTest
   }
 
   @AfterAll
-  static void joinConsumerJob(
-      @Autowired
-      KafkaServicesApplicationRunner applicationRunner)
+  static void joinConsumerJob(@Autowired KafkaServicesApplicationRunner applicationRunner)
   {
     applicationRunner.joinChatRoomChannelConsumerJob();
   }