From 2129eecd1923332b4544445a554e9c3190a87ee7 Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Mon, 8 Apr 2024 11:39:33 +0200 Subject: [PATCH] Configure Serdes from TestTopology --- .../TestTopology.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/TestTopology.java b/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/TestTopology.java index 0605854..3fdbb38 100644 --- a/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/TestTopology.java +++ b/fluent-kafka-streams-tests/src/main/java/com/bakdata/fluent_kafka_streams_tests/TestTopology.java @@ -451,6 +451,28 @@ public void stop() { } } + /** + * Configure a {@code Serde} for values using {@link #properties} + * @param serde serde to configure + * @return configured {@code Serde} + * @param type to be (de-)serialized + */ + public Serde configureValueSerde(final Serde serde) { + serde.configure(this.properties, false); + return serde; + } + + /** + * Configure a {@code Serde} for keys using {@link #properties} + * @param serde serde to configure + * @return configured {@code Serde} + * @param type to be (de-)serialized + */ + public Serde configureKeySerde(final Serde serde) { + serde.configure(this.properties, true); + return serde; + } + private Properties getProperties() { final Properties props = new Properties(); props.putAll(this.properties);