diff --git a/streams-bootstrap-core/src/test/java/com/bakdata/kafka/AvroMirrorTest.java b/streams-bootstrap-core/src/test/java/com/bakdata/kafka/AvroMirrorTest.java index ef2535be..1f3d1c6d 100644 --- a/streams-bootstrap-core/src/test/java/com/bakdata/kafka/AvroMirrorTest.java +++ b/streams-bootstrap-core/src/test/java/com/bakdata/kafka/AvroMirrorTest.java @@ -35,7 +35,7 @@ class AvroMirrorTest { private final ConfiguredStreamsApp app = createApp(); @RegisterExtension final TestTopologyExtension testTopology = - StreamsBootstrapTopologyFactory.createTopologyExtensionWithSchemaRegistry(this.app); + TestTopologyFactory.createTopologyExtensionWithSchemaRegistry(this.app); private static ConfiguredStreamsApp createApp() { final AppConfiguration configuration = new AppConfiguration<>(StreamsTopicConfig.builder() @@ -69,7 +69,7 @@ private Serde getValueSerde() { } private Configurator createSerdeFactory() { - return StreamsBootstrapTopologyFactory.createConfigurator(this.testTopology); + return TestTopologyFactory.createConfigurator(this.testTopology); } private Serde getKeySerde() { diff --git a/streams-bootstrap-test/src/main/java/com/bakdata/kafka/StreamsBootstrapTopologyFactory.java b/streams-bootstrap-test/src/main/java/com/bakdata/kafka/TestTopologyFactory.java similarity index 92% rename from streams-bootstrap-test/src/main/java/com/bakdata/kafka/StreamsBootstrapTopologyFactory.java rename to streams-bootstrap-test/src/main/java/com/bakdata/kafka/TestTopologyFactory.java index 6bc4c737..c87e8cd7 100644 --- a/streams-bootstrap-test/src/main/java/com/bakdata/kafka/StreamsBootstrapTopologyFactory.java +++ b/streams-bootstrap-test/src/main/java/com/bakdata/kafka/TestTopologyFactory.java @@ -35,7 +35,7 @@ * Utility class that provides helpers for using Fluent Kafka Streams Tests with {@link ConfiguredStreamsApp} */ @UtilityClass -public class StreamsBootstrapTopologyFactory { +public class TestTopologyFactory { /** * Create a {@code TestTopology} from a {@code ConfiguredStreamsApp}. It injects are {@link KafkaEndpointConfig} @@ -112,12 +112,7 @@ public static TestTopologyExtension createTopologyExtension( */ public static Function> getKafkaPropertiesWithSchemaRegistryUrl( final ConfiguredStreamsApp app) { - return schemaRegistryUrl -> { - final KafkaEndpointConfig endpointConfig = newEndpointConfig() - .schemaRegistryUrl(schemaRegistryUrl) - .build(); - return app.getKafkaProperties(endpointConfig); - }; + return schemaRegistryUrl -> getKafkaProperties(app, schemaRegistryUrl); } /** @@ -131,14 +126,18 @@ public static Configurator createConfigurator(final TestTopology testTopol return new Configurator(testTopology.getProperties()); } - private static Map getKafkaProperties(final ConfiguredStreamsApp app) { - final KafkaEndpointConfig endpointConfig = createEndpointConfig(); + private static Map getKafkaProperties(final ConfiguredStreamsApp app, + final String schemaRegistryUrl) { + final KafkaEndpointConfig endpointConfig = newEndpointConfig() + .schemaRegistryUrl(schemaRegistryUrl) + .build(); return app.getKafkaProperties(endpointConfig); } - private static KafkaEndpointConfig createEndpointConfig() { - return newEndpointConfig() + private static Map getKafkaProperties(final ConfiguredStreamsApp app) { + final KafkaEndpointConfig endpointConfig = newEndpointConfig() .build(); + return app.getKafkaProperties(endpointConfig); } private static KafkaEndpointConfigBuilder newEndpointConfig() {