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 aTestTopologyfrom aConfiguredStreamsApp.<K,V> com.bakdata.fluent_kafka_streams_tests.junit5.TestTopologyExtension<K, V> createTopologyExtension(ConfiguredStreamsApp<? extends StreamsApp> app) Create aTestTopologyExtensionfrom aConfiguredStreamsApp.getKafkaProperties(ConfiguredStreamsApp<? extends StreamsApp> app) Get Kafka properties from aConfiguredStreamsAppusing aRuntimeConfigurationfor test purposes with Schema Registry optionally configured.Configure arbitrary Kafka properties for the application under teststatic TestTopologyFactoryCreate a newTestTopologyFactorywith configured Schema Registry.static TestTopologyFactorywithSchemaRegistry(TestSchemaRegistry schemaRegistry) Create a newTestTopologyFactorywith configured Schema Registry.
-
Constructor Details
-
TestTopologyFactory
public TestTopologyFactory()Create a newTestTopologyFactory
-
-
Method Details
-
withSchemaRegistry
Create a newTestTopologyFactorywith configured Schema Registry. The scope is random in order to avoid collisions between different test instances as scopes are retained globally.- Returns:
TestTopologyFactorywith configured Schema Registry
-
withSchemaRegistry
Create a newTestTopologyFactorywith configured Schema Registry.- Parameters:
schemaRegistry- Schema Registry to use- Returns:
TestTopologyFactorywith configured Schema Registry
-
with
Configure arbitrary Kafka properties for the application under test- Parameters:
kafkaProperties- properties to configure- Returns:
- a copy of this
TestTopologyFactorywith provided properties
-
createTopology
public <K,V> com.bakdata.fluent_kafka_streams_tests.TestTopology<K,V> createTopology(ConfiguredStreamsApp<? extends StreamsApp> app) Create aTestTopologyfrom aConfiguredStreamsApp. It injects aRuntimeConfigurationfor 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:
TestTopologythat 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 aTestTopologyExtensionfrom aConfiguredStreamsApp. It injects aRuntimeConfigurationfor 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:
TestTopologyExtensionthat uses topology and configuration provided byConfiguredStreamsApp- See Also:
-
getKafkaProperties
Get Kafka properties from aConfiguredStreamsAppusing aRuntimeConfigurationfor test purposes with Schema Registry optionally configured.- Parameters:
app- ConfiguredStreamsApp to get Kafka properties of- Returns:
- Kafka properties
- See Also:
-