counter: 1.3.1 - Refined `CounterStreamProcessor` (DRY for type-mapping)
[demos/kafka/wordcount] / src / test / java / de / juplo / kafka / wordcount / counter / CounterStreamProcessorTopologyTest.java
index 06a0798..cfb6bd8 100644 (file)
@@ -20,7 +20,6 @@ import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.util.MultiValueMap;
 
 import java.util.Map;
-import java.util.stream.Collectors;
 
 import static de.juplo.kafka.wordcount.counter.CounterApplicationConfiguriation.serializationConfig;
 import static de.juplo.kafka.wordcount.counter.CounterStreamProcessor.STORE_NAME;
@@ -107,17 +106,6 @@ public class CounterStreamProcessorTopologyTest
 
   private static String typeMappingsConfig()
   {
-    return typeMappings()
-        .entrySet()
-        .stream()
-        .map(entry -> entry.getKey() + ":" + entry.getValue().getName())
-        .collect(Collectors.joining(","));
-  }
-
-  private static Map<String, Class> typeMappings()
-  {
-    return Map.of(
-        "word", TestOutputWord.class,
-        "counter", TestOutputWordCounter.class);
+    return CounterStreamProcessor.typeMappingsConfig(TestOutputWord.class, TestOutputWordCounter.class);
   }
 }