SchemaRegistryContainer

class safir.testing.containers.SchemaRegistryContainer(network, kafka_bootstrap_servers='kafka:9092', image='confluentinc/cp-schema-registry:7.6.0', **kwargs)

Bases: DockerContainer

A Testcontainers Confluent schema registry container.

Parameters:
  • network (Network) – Docker network to put this container in. The Kafa container that will serve as storage must be on the same network.

  • kafka_bootstrap_servers (str, default: 'kafka:9092') – Comma-separated list of Kafka boostrap servers for the Kafka instance that will serve as storage.

  • image (str, default: 'confluentinc/cp-schema-registry:7.6.0') – Docker image to use.

  • kwargs (dict[str, Any])

Methods Summary

get_url()

Construct the URL to the schema registry.

health()

Check the health of the container.

reset()

Reset the contents of the schema registry to its initial state.

start(*args, **kwargs)

Start the container.

Methods Documentation

get_url()

Construct the URL to the schema registry.

Return type:

str

health()

Check the health of the container.

Consider the container healthy once the schema registry can be contacted from the host network.

Return type:

None

reset()

Reset the contents of the schema registry to its initial state.

Return type:

None

start(*args, **kwargs)

Start the container.

Wait for health after starting the container. Any arguments are passed verbatim to the standard testcontainers start method.

Parameters:
Return type:

Self