diff --git a/tw-tkms-starter/src/test/java/com/transferwise/kafka/tkms/MessageDecorationTest.java b/tw-tkms-starter/src/test/java/com/transferwise/kafka/tkms/MessageDecorationTest.java index 27fc2ac..6768f08 100644 --- a/tw-tkms-starter/src/test/java/com/transferwise/kafka/tkms/MessageDecorationTest.java +++ b/tw-tkms-starter/src/test/java/com/transferwise/kafka/tkms/MessageDecorationTest.java @@ -58,7 +58,7 @@ void messagesAreDecorateWithJambi() { private void checkForHeader(SentMessage sentMessage, String key, String value) { assertTrue( StreamSupport.stream(sentMessage.getProducerRecord().headers().spliterator(), false) - .anyMatch(h -> h.key().equals(key) && value.equals(new String(h.value()))) + .anyMatch(h -> h.key().equals(key) && value.equals(new String(h.value(), StandardCharsets.UTF_8))) ); } } diff --git a/tw-tkms-starter/src/test/java/com/transferwise/kafka/tkms/test/TestMessageDecorator.java b/tw-tkms-starter/src/test/java/com/transferwise/kafka/tkms/test/TestMessageDecorator.java index 6353b3b..10147e3 100644 --- a/tw-tkms-starter/src/test/java/com/transferwise/kafka/tkms/test/TestMessageDecorator.java +++ b/tw-tkms-starter/src/test/java/com/transferwise/kafka/tkms/test/TestMessageDecorator.java @@ -3,6 +3,7 @@ import com.transferwise.kafka.tkms.api.ITkmsMessageDecorator; import com.transferwise.kafka.tkms.api.TkmsMessage; import com.transferwise.kafka.tkms.api.TkmsMessage.Header; +import java.nio.charset.StandardCharsets; import java.util.List; import org.springframework.stereotype.Component; @@ -11,7 +12,7 @@ public class TestMessageDecorator implements ITkmsMessageDecorator { @Override public List
getHeaders(TkmsMessage message) { - var h1 = new Header().setKey("tool").setValue("jambi".getBytes()); + var h1 = new Header().setKey("tool").setValue("jambi".getBytes(StandardCharsets.UTF_8)); if (message.getKey() == null) { return List.of(); }