From: Kai Moritz Date: Sat, 3 Feb 2024 20:05:35 +0000 (+0100) Subject: WIP X-Git-Tag: rebase--2024-02-26--19-46~39 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=337a977d57a07f317474f47dbe47b2ee5a9b8cb7;p=demos%2Fkafka%2Fchat WIP --- diff --git a/src/test/java/de/juplo/kafka/chat/backend/KafkaHandoverIT.java b/src/test/java/de/juplo/kafka/chat/backend/KafkaHandoverIT.java index 3b4c4761..afb373f0 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/KafkaHandoverIT.java +++ b/src/test/java/de/juplo/kafka/chat/backend/KafkaHandoverIT.java @@ -13,6 +13,7 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import org.springframework.kafka.core.KafkaTemplate; import org.springframework.kafka.test.context.EmbeddedKafka; +import org.testcontainers.junit.jupiter.Container; import static de.juplo.kafka.chat.backend.KafkaConfigurationIT.DATA_TOPIC; import static de.juplo.kafka.chat.backend.KafkaConfigurationIT.INFO_TOPIC; @@ -30,42 +31,14 @@ import static de.juplo.kafka.chat.backend.KafkaConfigurationIT.INFO_TOPIC; "chat.backend.kafka.data-channel-topic=" + DATA_TOPIC, "chat.backend.kafka.num-partitions=10", }) -@EmbeddedKafka( - topics = { INFO_TOPIC, DATA_TOPIC }, - partitions = 10) @Slf4j class KafkaHandoverIT extends AbstractHandoverIT { - final static String INFO_TOPIC = "KAFKA_HANDOVER_IT_INFO_CHANNEL"; - final static String DATA_TOPIC = "KAFKA_HANDOVER_IT_DATA_CHANNEL"; - - @MockBean - KafkaServicesApplicationRunner kafkaServicesApplicationRunner; - @BeforeAll - public static void sendAndLoadStoredData( - @Autowired KafkaTemplate messageTemplate, - @Autowired ConsumerTaskRunner consumerTaskRunner) + public static void setUp() { - KafkaTestUtils.sendAndLoadStoredData( - messageTemplate, - INFO_TOPIC, - DATA_TOPIC, - consumerTaskRunner); } - @AfterAll - static void joinConsumerTasks( - @Autowired ConsumerTaskRunner consumerTaskRunner) - throws InterruptedException - { - KafkaTestUtils.joinConsumerTasks(consumerTaskRunner); - } + @Container - - @TestConfiguration - @Import(KafkaTestUtils.KafkaTestConfiguration.class) - static class KafkaConfigurationITConfiguration - { - } }