From 6500abf8a211334e869de7cc2f354368f0263bc1 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Mon, 3 Jun 2024 10:00:33 +0200 Subject: [PATCH] top10: 1.2.1 - Removed logging of type-headers in tests --- .../de/juplo/kafka/wordcount/top10/TestData.java | 15 --------------- .../top10/Top10StreamProcessorTopologyTest.java | 14 +------------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/src/test/java/de/juplo/kafka/wordcount/top10/TestData.java b/src/test/java/de/juplo/kafka/wordcount/top10/TestData.java index f4e557c..e0c53df 100644 --- a/src/test/java/de/juplo/kafka/wordcount/top10/TestData.java +++ b/src/test/java/de/juplo/kafka/wordcount/top10/TestData.java @@ -2,8 +2,6 @@ package de.juplo.kafka.wordcount.top10; import de.juplo.kafka.wordcount.counter.TestCounter; import de.juplo.kafka.wordcount.counter.TestWord; -import org.apache.kafka.common.header.Header; -import org.apache.kafka.common.header.Headers; import org.apache.kafka.streams.KeyValue; import org.apache.kafka.streams.state.ReadOnlyKeyValueStore; import org.springframework.util.LinkedMultiValueMap; @@ -174,17 +172,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()); - } - } } diff --git a/src/test/java/de/juplo/kafka/wordcount/top10/Top10StreamProcessorTopologyTest.java b/src/test/java/de/juplo/kafka/wordcount/top10/Top10StreamProcessorTopologyTest.java index f2a9eca..84cfb1e 100644 --- a/src/test/java/de/juplo/kafka/wordcount/top10/Top10StreamProcessorTopologyTest.java +++ b/src/test/java/de/juplo/kafka/wordcount/top10/Top10StreamProcessorTopologyTest.java @@ -20,10 +20,7 @@ import java.util.Map; import java.util.Properties; import java.util.stream.Stream; -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; @Slf4j @@ -84,16 +81,7 @@ public class Top10StreamProcessorTopologyTest MultiValueMap 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); -- 2.20.1