Package com.bakdata.kafka
Class TestSchemaRegistry
java.lang.Object
com.bakdata.kafka.TestSchemaRegistry
Class that provides helpers for using schema registry in tests.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a newTestSchemaRegistry
.TestSchemaRegistry
(@NonNull String schemaRegistryUrl) -
Method Summary
Modifier and TypeMethodDescriptionconfigure
(RuntimeConfiguration configuration) Configure the schema registry for the providedRuntimeConfiguration
io.confluent.kafka.schemaregistry.client.SchemaRegistryClient
GetSchemaRegistryClient
for configured URL with default providersio.confluent.kafka.schemaregistry.client.SchemaRegistryClient
getSchemaRegistryClient
(List<io.confluent.kafka.schemaregistry.SchemaProvider> providers) GetSchemaRegistryClient
for configured URL@NonNull String
-
Constructor Details
-
TestSchemaRegistry
public TestSchemaRegistry()Create a newTestSchemaRegistry
. The scope is random in order to avoid collisions between different test instances as scopes are retained globally. -
TestSchemaRegistry
-
-
Method Details
-
getSchemaRegistryClient
public io.confluent.kafka.schemaregistry.client.SchemaRegistryClient getSchemaRegistryClient()GetSchemaRegistryClient
for configured URL with default providers- Returns:
SchemaRegistryClient
- Throws:
NullPointerException
- if Schema Registry is not configured
-
getSchemaRegistryClient
public io.confluent.kafka.schemaregistry.client.SchemaRegistryClient getSchemaRegistryClient(List<io.confluent.kafka.schemaregistry.SchemaProvider> providers) GetSchemaRegistryClient
for configured URL- Parameters:
providers
- list ofSchemaProvider
to use forSchemaRegistryClient
- Returns:
SchemaRegistryClient
- Throws:
NullPointerException
- if Schema Registry is not configured
-
configure
Configure the schema registry for the providedRuntimeConfiguration
- Parameters:
configuration
-RuntimeConfiguration
- Returns:
RuntimeConfiguration
with configured schema registry- See Also:
-
getSchemaRegistryUrl
-