Package com.bakdata.kafka.streams
Class TestTopologyFactory
java.lang.Object
com.bakdata.kafka.streams.TestTopologyFactory
Class that provides helpers for using Fluent Kafka Streams Tests with
ConfiguredStreamsApp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<K,
V> com.bakdata.fluent_kafka_streams_tests.TestTopology<K, V> createTopology
(ConfiguredStreamsApp<? extends StreamsApp> app) Create aTestTopology
from aConfiguredStreamsApp
.<K,
V> com.bakdata.fluent_kafka_streams_tests.junit5.TestTopologyExtension<K, V> createTopologyExtension
(ConfiguredStreamsApp<? extends StreamsApp> app) Create aTestTopologyExtension
from aConfiguredStreamsApp
.getKafkaProperties
(ConfiguredStreamsApp<? extends StreamsApp> app) Get Kafka properties from aConfiguredStreamsApp
using aRuntimeConfiguration
for test purposes with Schema Registry optionally configured.Configure arbitrary Kafka properties for the application under teststatic TestTopologyFactory
Create a newTestTopologyFactory
with configured Schema Registry.static TestTopologyFactory
withSchemaRegistry
(TestSchemaRegistry schemaRegistry) Create a newTestTopologyFactory
with configured Schema Registry.
-
Constructor Details
-
TestTopologyFactory
public TestTopologyFactory()Create a newTestTopologyFactory
-
-
Method Details
-
withSchemaRegistry
Create a newTestTopologyFactory
with configured Schema Registry. The scope is random in order to avoid collisions between different test instances as scopes are retained globally.- Returns:
TestTopologyFactory
with configured Schema Registry
-
withSchemaRegistry
Create a newTestTopologyFactory
with configured Schema Registry.- Parameters:
schemaRegistry
- Schema Registry to use- Returns:
TestTopologyFactory
with configured Schema Registry
-
with
Configure arbitrary Kafka properties for the application under test- Parameters:
kafkaProperties
- properties to configure- Returns:
- a copy of this
TestTopologyFactory
with provided properties
-
createTopology
public <K,V> com.bakdata.fluent_kafka_streams_tests.TestTopology<K,V> createTopology(ConfiguredStreamsApp<? extends StreamsApp> app) Create aTestTopology
from aConfiguredStreamsApp
. It injects aRuntimeConfiguration
for test purposes with Schema Registry optionally configured.- Type Parameters:
K
- Default type of keysV
- Default type of values- Parameters:
app
- ConfiguredStreamsApp to create TestTopology from- Returns:
TestTopology
that uses topology and configuration provided byConfiguredStreamsApp
- See Also:
-
createTopologyExtension
public <K,V> com.bakdata.fluent_kafka_streams_tests.junit5.TestTopologyExtension<K,V> createTopologyExtension(ConfiguredStreamsApp<? extends StreamsApp> app) Create aTestTopologyExtension
from aConfiguredStreamsApp
. It injects aRuntimeConfiguration
for test purposes with Schema Registry optionally configured.- Type Parameters:
K
- Default type of keysV
- Default type of values- Parameters:
app
- ConfiguredStreamsApp to create TestTopology from- Returns:
TestTopologyExtension
that uses topology and configuration provided byConfiguredStreamsApp
- See Also:
-
getKafkaProperties
Get Kafka properties from aConfiguredStreamsApp
using aRuntimeConfiguration
for test purposes with Schema Registry optionally configured.- Parameters:
app
- ConfiguredStreamsApp to get Kafka properties of- Returns:
- Kafka properties
- See Also:
-