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 aTestTopology
from aKafkaStreamsApplication
.<K,
V> com.bakdata.fluent_kafka_streams_tests.junit5.TestTopologyExtension<K, V> createTopologyExtension
(KafkaStreamsApplication<? extends StreamsApp> app) Create aTestTopologyExtension
from aKafkaStreamsApplication
.getKafkaProperties
(KafkaStreamsApplication<? extends StreamsApp> app) Get Kafka properties from aKafkaStreamsApplication
using aRuntimeConfiguration
for test purposes with Schema Registry optionally configured.Configure arbitrary Kafka properties for the application under testCreate a newTestApplicationTopologyFactory
with configured Schema Registry.withSchemaRegistry
(TestSchemaRegistry schemaRegistry) Create a newTestApplicationTopologyFactory
with configured Schema Registry.
-
Constructor Details
-
TestApplicationTopologyFactory
public TestApplicationTopologyFactory()Create a newTestApplicationTopologyFactory
-
-
Method Details
-
withSchemaRegistry
Create a newTestApplicationTopologyFactory
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 newTestApplicationTopologyFactory
with configured Schema Registry.- Parameters:
schemaRegistry
- Schema Registry to use- Returns:
TestApplicationTopologyFactory
with configured Schema Registry
-
with
Configure arbitrary Kafka properties for the application under test- Parameters:
kafkaProperties
- properties to configure- Returns:
- a copy of this
TestApplicationTopologyFactory
with provided properties
-
createTopology
public <K,V> com.bakdata.fluent_kafka_streams_tests.TestTopology<K,V> createTopology(KafkaStreamsApplication<? extends StreamsApp> app) Create aTestTopology
from aKafkaStreamsApplication
. It injects aRuntimeConfiguration
for 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:
TestTopology
that 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 aTestTopologyExtension
from aKafkaStreamsApplication
. It injects aRuntimeConfiguration
for 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:
TestTopologyExtension
that uses topology and configuration provided byKafkaStreamsApplication
- See Also:
-
getKafkaProperties
Get Kafka properties from aKafkaStreamsApplication
using aRuntimeConfiguration
for test purposes with Schema Registry optionally configured.- Parameters:
app
- KafkaStreamsApplication to get Kafka properties of- Returns:
- Kafka properties
- See Also:
-