From 04901a23865d1ce82bb6541164751be200a4f621 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Thu, 30 Jun 2022 17:36:11 +0200 Subject: [PATCH] WIP --- .../kafka/wordcount/splitter/ApplicationTests.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/test/java/de/juplo/kafka/wordcount/splitter/ApplicationTests.java b/src/test/java/de/juplo/kafka/wordcount/splitter/ApplicationTests.java index 274efa9..9165180 100644 --- a/src/test/java/de/juplo/kafka/wordcount/splitter/ApplicationTests.java +++ b/src/test/java/de/juplo/kafka/wordcount/splitter/ApplicationTests.java @@ -3,14 +3,9 @@ package de.juplo.kafka.wordcount.splitter; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.util.TestPropertyValues; -import org.springframework.context.ApplicationContextInitializer; -import org.springframework.context.ConfigurableApplicationContext; import org.springframework.kafka.core.KafkaTemplate; import org.springframework.kafka.test.EmbeddedKafkaBroker; import org.springframework.kafka.test.context.EmbeddedKafka; -import org.springframework.test.context.DynamicPropertyRegistry; -import org.springframework.test.context.DynamicPropertySource; import static de.juplo.kafka.wordcount.splitter.ApplicationTests.TOPIC_IN; import static de.juplo.kafka.wordcount.splitter.ApplicationTests.TOPIC_OUT; @@ -18,11 +13,11 @@ import static de.juplo.kafka.wordcount.splitter.ApplicationTests.TOPIC_OUT; @SpringBootTest( properties = { + "juplo.wordcount.splitter.bootstrap-server=${spring.embedded.kafka.brokers", "juplo.wordcount.splitter.input-topic=" + TOPIC_IN, "juplo.wordcount.splitter.outtput-topic=" + TOPIC_OUT, }) @EmbeddedKafka( - bootstrapServersProperty = "juplo.wordcount.splitter.bootstrap-server", topics = { TOPIC_IN, TOPIC_OUT }, brokerProperties = { "transaction.state.log.replication.factor=1", @@ -51,11 +46,4 @@ class ApplicationTests { kafkaTemplate.send(TOPIC_IN, "Hello World!"); } - - - @DynamicPropertySource - static void registerProperties(DynamicPropertyRegistry registry) - { - registry.add("") - } } -- 2.20.1