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;
"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<String, String> 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
- {
- }
}