Class TestSchemaRegistry

java.lang.Object
com.bakdata.kafka.TestSchemaRegistry

public final class TestSchemaRegistry extends Object
Class that provides helpers for using schema registry in tests.
  • Constructor Details

    • TestSchemaRegistry

      public TestSchemaRegistry()
      Create a new TestSchemaRegistry. The scope is random in order to avoid collisions between different test instances as scopes are retained globally.
    • TestSchemaRegistry

      public TestSchemaRegistry(@NonNull @NonNull String schemaRegistryUrl)
  • Method Details

    • getSchemaRegistryClient

      public io.confluent.kafka.schemaregistry.client.SchemaRegistryClient getSchemaRegistryClient()
      Get SchemaRegistryClient 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)
      Get SchemaRegistryClient for configured URL
      Parameters:
      providers - list of SchemaProvider to use for SchemaRegistryClient
      Returns:
      SchemaRegistryClient
      Throws:
      NullPointerException - if Schema Registry is not configured
    • configure

      public RuntimeConfiguration configure(RuntimeConfiguration configuration)
      Configure the schema registry for the provided RuntimeConfiguration
      Parameters:
      configuration - RuntimeConfiguration
      Returns:
      RuntimeConfiguration with configured schema registry
      See Also:
    • getSchemaRegistryUrl

      @NonNull public @NonNull String getSchemaRegistryUrl()