From a07e20011b1a22d120920e84c36683a9d42c3ac5 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 12 Jun 2024 23:08:57 +0200 Subject: [PATCH] query: 2.0.0 - (RED) Corrected expectations for the ``users``-input-topic * The messages that are written by the `users` service doese _not_ contain any type-information. * This commits corrects the corresponding expectations in the test-cases. * *RED:* The tests fail, because the implementation was not yet fixed! --- .../de/juplo/kafka/wordcount/query/QueryApplicationIT.java | 3 +-- .../wordcount/query/QueryStreamProcessorTopologyTest.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/java/de/juplo/kafka/wordcount/query/QueryApplicationIT.java b/src/test/java/de/juplo/kafka/wordcount/query/QueryApplicationIT.java index 5eb4706..19ada51 100644 --- a/src/test/java/de/juplo/kafka/wordcount/query/QueryApplicationIT.java +++ b/src/test/java/de/juplo/kafka/wordcount/query/QueryApplicationIT.java @@ -2,7 +2,6 @@ package de.juplo.kafka.wordcount.query; import com.fasterxml.jackson.databind.ObjectMapper; import de.juplo.kafka.wordcount.top10.TestRanking; -import de.juplo.kafka.wordcount.users.TestUserData; import lombok.extern.slf4j.Slf4j; import org.apache.kafka.clients.producer.ProducerConfig; import org.apache.kafka.common.serialization.StringSerializer; @@ -143,7 +142,7 @@ public class QueryApplicationIT Map properties = Map.of( ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName(), ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class.getName(), - JsonSerializer.TYPE_MAPPINGS, "userdata:" + TestUserData.class.getName()); + JsonSerializer.ADD_TYPE_INFO_HEADERS, false); return new KafkaTemplate(producerFactory, properties); } diff --git a/src/test/java/de/juplo/kafka/wordcount/query/QueryStreamProcessorTopologyTest.java b/src/test/java/de/juplo/kafka/wordcount/query/QueryStreamProcessorTopologyTest.java index 1a857b7..fda7408 100644 --- a/src/test/java/de/juplo/kafka/wordcount/query/QueryStreamProcessorTopologyTest.java +++ b/src/test/java/de/juplo/kafka/wordcount/query/QueryStreamProcessorTopologyTest.java @@ -52,7 +52,7 @@ public class QueryStreamProcessorTopologyTest userIn = testDriver.createInputTopic( USERS_IN, new StringSerializer(), - jsonSerializer(TestUserData.class)); + jsonSerializer(TestUserData.class).noTypeInfo()); } @@ -82,7 +82,6 @@ public class QueryStreamProcessorTopologyTest jsonSerializer.configure( Map.of( JsonSerializer.TYPE_MAPPINGS, - "userdata:" + TestUserData.class.getName() + "," + "ranking:" + TestRanking.class.getName()), false); return jsonSerializer; -- 2.20.1