counter: 1.3.1 - Cleand code/setup for tests
[demos/kafka/wordcount] / src / test / java / de / juplo / kafka / wordcount / counter / CounterApplicationIT.java
index 334cd05..0faa2de 100644 (file)
@@ -14,7 +14,6 @@ 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.context.annotation.Primary;
 import org.springframework.kafka.annotation.KafkaListener;
 import org.springframework.kafka.core.KafkaTemplate;
 import org.springframework.kafka.support.KafkaHeaders;
@@ -35,6 +34,7 @@ import static org.awaitility.Awaitility.await;
 
 @SpringBootTest(
                properties = {
+                               "spring.main.allow-bean-definition-overriding=true",
                                "spring.kafka.producer.key-serializer=org.springframework.kafka.support.serializer.JsonSerializer",
                                "spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer",
                                "spring.kafka.producer.properties.spring.json.add.type.headers=false",
@@ -45,7 +45,8 @@ import static org.awaitility.Awaitility.await;
                                "logging.level.root=WARN",
                                "logging.level.de.juplo=DEBUG",
                                "juplo.wordcount.counter.bootstrap-server=${spring.embedded.kafka.brokers}",
-                               "juplo.wordcount.counter.commit-interval=0",
+                               "juplo.wordcount.counter.commit-interval=100",
+                               "juplo.wordcount.counter.cache-max-bytes=0",
                                "juplo.wordcount.counter.input-topic=" + TOPIC_IN,
                                "juplo.wordcount.counter.output-topic=" + TOPIC_OUT })
 @EmbeddedKafka(topics = { TOPIC_IN, TOPIC_OUT })
@@ -155,9 +156,8 @@ public class CounterApplicationIT
                        return new Consumer();
                }
 
-               @Primary
                @Bean
-               KeyValueBytesStoreSupplier inMemoryStoreSupplier()
+               KeyValueBytesStoreSupplier storeSupplier()
                {
                        return Stores.inMemoryKeyValueStore(STORE_NAME);
                }