counter: 1.2.15 - Removed logging of type-headers in tests
authorKai Moritz <kai@juplo.de>
Wed, 5 Jun 2024 18:29:37 +0000 (20:29 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 8 Jun 2024 11:33:30 +0000 (13:33 +0200)
src/main/java/de/juplo/kafka/wordcount/counter/CounterApplicationConfiguriation.java
src/test/java/de/juplo/kafka/wordcount/counter/CounterStreamProcessorTopologyTest.java
src/test/java/de/juplo/kafka/wordcount/counter/TestData.java

index e38a0f8..3878dba 100644 (file)
@@ -53,7 +53,6 @@ public class CounterApplicationConfiguriation
                                JsonDeserializer.TYPE_MAPPINGS,
                                "word:" + Word.class.getName() + "," +
                                "counter:" + WordCounter.class.getName());
-               propertyMap.put(JsonDeserializer.REMOVE_TYPE_INFO_HEADERS, Boolean.FALSE);
 
                return propertyMap;
        }
index e5964dc..955d7a0 100644 (file)
@@ -19,9 +19,6 @@ import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.util.MultiValueMap;
 
 import static de.juplo.kafka.wordcount.counter.CounterApplicationConfiguriation.serializationConfig;
-import static de.juplo.kafka.wordcount.counter.TestData.parseHeader;
-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;
 
 
 @Slf4j
@@ -72,16 +69,7 @@ public class CounterStreamProcessorTopologyTest
     MultiValueMap<TestOutputWord, TestOutputWordCounter> receivedMessages = new LinkedMultiValueMap<>();
     out
         .readRecordsToList()
-        .forEach(record ->
-        {
-          log.debug(
-              "OUT: {} -> {}, {}, {}",
-              record.key(),
-              record.value(),
-              parseHeader(record.headers(), KEY_DEFAULT_CLASSID_FIELD_NAME),
-              parseHeader(record.headers(), DEFAULT_CLASSID_FIELD_NAME));
-          receivedMessages.add(record.key(), record.value());
-        });
+        .forEach(record -> receivedMessages.add(record.key(), record.value()));
 
     TestData.assertExpectedMessages(receivedMessages);
   }
index 6419059..40ef09e 100644 (file)
@@ -3,8 +3,6 @@ package de.juplo.kafka.wordcount.counter;
 import de.juplo.kafka.wordcount.splitter.TestInputWord;
 import de.juplo.kafka.wordcount.top10.TestOutputWord;
 import de.juplo.kafka.wordcount.top10.TestOutputWordCounter;
-import org.apache.kafka.common.header.Header;
-import org.apache.kafka.common.header.Headers;
 import org.apache.kafka.streams.KeyValue;
 import org.springframework.util.LinkedMultiValueMap;
 import org.springframework.util.MultiValueMap;
@@ -89,17 +87,4 @@ class TestData
                                .forEach(keyValue -> expectedMessages.add(keyValue.key, keyValue.value));
                return expectedMessages;
        }
-
-       static String parseHeader(Headers headers, String key)
-       {
-               Header header = headers.lastHeader(key);
-               if (header == null)
-               {
-                       return key + "=null";
-               }
-               else
-               {
-                       return key + "=" + new String(header.value());
-               }
-       }
 }