Separated Demo-Tests from Example-Tests demos
authorKai Moritz <kai@juplo.de>
Fri, 5 Jul 2024 20:45:58 +0000 (22:45 +0200)
committerKai Moritz <kai@juplo.de>
Fri, 5 Jul 2024 20:48:51 +0000 (22:48 +0200)
pom.xml
src/test/java/de/juplo/kafka/wordcount/counter/SpringBootTestExampleTest.java [deleted file]
src/test/java/de/juplo/kafka/wordcount/counter/SpringJunitConfigExampleTest.java [deleted file]

diff --git a/pom.xml b/pom.xml
index 091cc27..fdde5a9 100644 (file)
--- a/pom.xml
+++ b/pom.xml
        </parent>
 
        <groupId>de.juplo.kafka.streams.demos</groupId>
-       <artifactId>examples</artifactId>
+       <artifactId>demos</artifactId>
        <version>1.0.0-SNAPSHOT</version>
 
-       <name>Examples</name>
-       <description>Examples for Kafka Streams</description>
+       <name>Demos</name>
+       <description>Demo Tests for Kafka Streams</description>
 
        <properties>
                <java.version>21</java.version>
-               <docker-maven-plugin.version>0.44.0</docker-maven-plugin.version>
        </properties>
 
        <dependencies>
diff --git a/src/test/java/de/juplo/kafka/wordcount/counter/SpringBootTestExampleTest.java b/src/test/java/de/juplo/kafka/wordcount/counter/SpringBootTestExampleTest.java
deleted file mode 100644 (file)
index 8088427..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-package de.juplo.kafka.wordcount.counter;
-
-import lombok.extern.slf4j.Slf4j;
-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.context.TestConfiguration;
-import org.springframework.context.annotation.Bean;
-import org.springframework.kafka.annotation.KafkaListener;
-import org.springframework.kafka.core.KafkaTemplate;
-import org.springframework.kafka.support.KafkaHeaders;
-import org.springframework.kafka.test.context.EmbeddedKafka;
-import org.springframework.messaging.handler.annotation.Header;
-import org.springframework.messaging.handler.annotation.Payload;
-import org.springframework.test.annotation.DirtiesContext;
-
-
-@SpringBootTest
-@EmbeddedKafka(topics = "TEST")
-@DirtiesContext
-@Slf4j
-public class SpringBootTestExampleTest
-{
-  @Test
-  void testC(
-      @Autowired KafkaTemplate<String, String> template,
-      @Autowired Consumer consumer)
-  {
-    template.send("TEST", "peter", "Hallo Welt!");
-  }
-
-  static class Consumer
-  {
-    @KafkaListener(groupId = "test", topics = "TEST")
-    public void receive(
-        @Header(KafkaHeaders.RECEIVED_KEY) String key,
-        @Payload String value)
-    {
-      log.info("Received {}={}", key, value);
-    }
-  }
-
-  @TestConfiguration
-  static class Config
-  {
-    @Bean
-    Consumer consumer()
-    {
-      return new Consumer();
-    }
-  }
-
-}
diff --git a/src/test/java/de/juplo/kafka/wordcount/counter/SpringJunitConfigExampleTest.java b/src/test/java/de/juplo/kafka/wordcount/counter/SpringJunitConfigExampleTest.java
deleted file mode 100644 (file)
index ae2b22e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-package de.juplo.kafka.wordcount.counter;
-
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.kafka.core.KafkaTemplate;
-import org.springframework.kafka.test.EmbeddedKafkaBroker;
-import org.springframework.kafka.test.context.EmbeddedKafka;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
-
-
-@SpringJUnitConfig
-@EmbeddedKafka(topics = "TEST")
-@DirtiesContext
-@Slf4j
-public class SpringJunitConfigExampleTest
-{
-  @Test
-  void testValue(@Value("${spring.embedded.kafka.brokers}") String brokers)
-  {
-    log.info("Broker-Adress: {}", brokers);
-  }
-
-  @Test
-  void testEmbeddedKafkaBroker(@Autowired EmbeddedKafkaBroker broker)
-  {
-    log.info("Broker-Adress: {}", broker.getBrokersAsString());
-  }
-}