Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
Describes how to retrieve the schema registry address
  • Loading branch information
gustavo.monarin committed Oct 19, 2022
1 parent 2cec5f7 commit 9107005
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
6 changes: 6 additions & 0 deletions docs/modules/redpanda.md
Expand Up @@ -19,6 +19,12 @@ Now your tests or any other process running on your machine can get access to ru
[Bootstrap Servers](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:getBootstrapServers
<!--/codeinclude-->

Redpanda also provides a schema registry implementation. Like the Redpanda broker, you can access by using the following schema registry location:

<!--codeinclude-->
[Schema Registry](../../modules/redpanda/src/test/java/org/testcontainers/redpanda/RedpandaContainerTest.java) inside_block:getSchemaRegistryAddress
<!--/codeinclude-->

## Adding this module to your project dependencies

Add the following dependency to your `pom.xml`/`build.gradle` file:
Expand Down
Expand Up @@ -70,13 +70,16 @@ public void testSchemaRegistry() {
try (RedpandaContainer container = new RedpandaContainer(REDPANDA_DOCKER_IMAGE)) {
container.start();

io.restassured.response.Response response = RestAssured
.given()
.when()
.get(container.getSchemaRegistryAddress() + "/subjects")
.andReturn();
String subjectsEndpoint = String.format(
"%s/subjects",
// getSchemaRegistryAddress {
container.getSchemaRegistryAddress()
// }
);

io.restassured.response.Response subjects = RestAssured.given().when().get(subjectsEndpoint).andReturn();

assertThat(response.getStatusCode()).isEqualTo(200);
assertThat(subjects.getStatusCode()).isEqualTo(200);
}
}

Expand Down

0 comments on commit 9107005

Please sign in to comment.