top10: 1.2.1 - Refined `Top10StreamProcessorTopologyTest`
[demos/kafka/wordcount] / src / test / java / de / juplo / kafka / wordcount / top10 / Top10StreamProcessorTopologyTest.java
index 0c9759c..f2a9eca 100644 (file)
@@ -20,8 +20,8 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.stream.Stream;
 
-import static de.juplo.kafka.wordcount.top10.TestData.convertToMap;
 import static de.juplo.kafka.wordcount.top10.TestData.parseHeader;
+import static de.juplo.kafka.wordcount.top10.Top10ApplicationConfiguration.serializationConfig;
 import static org.springframework.kafka.support.mapping.AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME;
 import static org.springframework.kafka.support.mapping.AbstractJavaTypeMapper.KEY_DEFAULT_CLASSID_FIELD_NAME;
 
@@ -47,18 +47,17 @@ public class Top10StreamProcessorTopologyTest
         OUT,
         Stores.inMemoryKeyValueStore(STORE_NAME));
 
-    Top10ApplicationConfiguration applicationConfiguriation =
-        new Top10ApplicationConfiguration();
-    Properties streamProcessorProperties =
-        applicationConfiguriation.streamProcessorProperties(new Top10ApplicationProperties());
-    Map<String, Object> propertyMap = convertToMap(streamProcessorProperties);
+    Map<String, Object> propertyMap = serializationConfig();
+
+    Properties properties = new Properties();
+    properties.putAll(propertyMap);
 
     JsonSerde<?> keySerde = new JsonSerde<>();
     keySerde.configure(propertyMap, true);
     JsonSerde<?> valueSerde = new JsonSerde<>();
     valueSerde.configure(propertyMap, false);
 
-    testDriver = new TopologyTestDriver(topology, streamProcessorProperties);
+    testDriver = new TopologyTestDriver(topology, properties);
 
     in = testDriver.createInputTopic(
         IN,