query: 2.0.0 - (RED) Corrected expectations for the ``users``-input-topic
authorKai Moritz <kai@juplo.de>
Wed, 12 Jun 2024 21:08:57 +0000 (23:08 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 15 Jun 2024 06:30:47 +0000 (08:30 +0200)
* 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!

src/test/java/de/juplo/kafka/wordcount/query/QueryApplicationIT.java
src/test/java/de/juplo/kafka/wordcount/query/QueryStreamProcessorTopologyTest.java

index 5eb4706..19ada51 100644 (file)
@@ -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<String, Object> 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);
                }
 
index 1a857b7..fda7408 100644 (file)
@@ -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;