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 providedRuntimeConfigurationio.confluent.kafka.schemaregistry.client.SchemaRegistryClientGetSchemaRegistryClientfor configured URL with default providersio.confluent.kafka.schemaregistry.client.SchemaRegistryClientgetSchemaRegistryClient(List<io.confluent.kafka.schemaregistry.SchemaProvider> providers) GetSchemaRegistryClientfor 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()GetSchemaRegistryClientfor 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) GetSchemaRegistryClientfor configured URL- Parameters:
providers- list ofSchemaProviderto use forSchemaRegistryClient- Returns:
SchemaRegistryClient- Throws:
NullPointerException- if Schema Registry is not configured
-
configure
Configure the schema registry for the providedRuntimeConfiguration- Parameters:
configuration-RuntimeConfiguration- Returns:
RuntimeConfigurationwith configured schema registry- See Also:
-
getSchemaRegistryUrl
-