Package com.bakdata.kafka.streams
Class TestApplicationTopologyFactory
java.lang.Object
com.bakdata.kafka.streams.TestApplicationTopologyFactory
Class that provides helpers for using Fluent Kafka Streams Tests with
KafkaStreamsApplication-
Constructor Summary
ConstructorsConstructorDescriptionCreate a newTestApplicationTopologyFactory -
Method Summary
Modifier and TypeMethodDescription<K,V> com.bakdata.fluent_kafka_streams_tests.TestTopology<K, V> createTopology(KafkaStreamsApplication<? extends StreamsApp> app) Create aTestTopologyfrom aKafkaStreamsApplication.<K,V> com.bakdata.fluent_kafka_streams_tests.junit5.TestTopologyExtension<K, V> createTopologyExtension(KafkaStreamsApplication<? extends StreamsApp> app) Create aTestTopologyExtensionfrom aKafkaStreamsApplication.getKafkaProperties(KafkaStreamsApplication<? extends StreamsApp> app) Get Kafka properties from aKafkaStreamsApplicationusing aRuntimeConfigurationfor test purposes with Schema Registry optionally configured.Configure arbitrary Kafka properties for the application under testCreate a newTestApplicationTopologyFactorywith configured Schema Registry.withSchemaRegistry(TestSchemaRegistry schemaRegistry) Create a newTestApplicationTopologyFactorywith configured Schema Registry.
-
Constructor Details
-
TestApplicationTopologyFactory
public TestApplicationTopologyFactory()Create a newTestApplicationTopologyFactory
-
-
Method Details
-
withSchemaRegistry
Create a newTestApplicationTopologyFactorywith 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 newTestApplicationTopologyFactorywith configured Schema Registry.- Parameters:
schemaRegistry- Schema Registry to use- Returns:
TestApplicationTopologyFactorywith configured Schema Registry
-
with
Configure arbitrary Kafka properties for the application under test- Parameters:
kafkaProperties- properties to configure- Returns:
- a copy of this
TestApplicationTopologyFactorywith provided properties
-
createTopology
public <K,V> com.bakdata.fluent_kafka_streams_tests.TestTopology<K,V> createTopology(KafkaStreamsApplication<? extends StreamsApp> app) Create aTestTopologyfrom aKafkaStreamsApplication. It injects aRuntimeConfigurationfor test purposes with Schema Registry optionally configured.- Type Parameters:
K- Default type of keysV- Default type of values- Parameters:
app- KafkaStreamsApplication to create TestTopology from- Returns:
TestTopologythat uses topology and configuration provided byKafkaStreamsApplication- See Also:
-
createTopologyExtension
public <K,V> com.bakdata.fluent_kafka_streams_tests.junit5.TestTopologyExtension<K,V> createTopologyExtension(KafkaStreamsApplication<? extends StreamsApp> app) Create aTestTopologyExtensionfrom aKafkaStreamsApplication. It injects aRuntimeConfigurationfor test purposes with Schema Registry optionally configured.- Type Parameters:
K- Default type of keysV- Default type of values- Parameters:
app- KafkaStreamsApplication to create TestTopology from- Returns:
TestTopologyExtensionthat uses topology and configuration provided byKafkaStreamsApplication- See Also:
-
getKafkaProperties
Get Kafka properties from aKafkaStreamsApplicationusing aRuntimeConfigurationfor test purposes with Schema Registry optionally configured.- Parameters:
app- KafkaStreamsApplication to get Kafka properties of- Returns:
- Kafka properties
- See Also:
-