Skip to content

Commit

Permalink
Improve doc in README
Browse files Browse the repository at this point in the history
  • Loading branch information
fnobilia committed Nov 29, 2020
1 parent d451423 commit 37b5b88
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,27 @@
| [schemaregistry-junit4](https://mvnrepository.com/artifact/io.github.data-rocks-team/schemaregistry-junit4) | [![Maven Central](https://img.shields.io/maven-central/v/io.github.data-rocks-team/schemaregistry-junit4.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.github.data-rocks-team%20a%3Aschemaregistry-junit4) | [![Javadocs](http://www.javadoc.io/badge/io.github.data-rocks-team/schemaregistry-junit4.svg)](http://www.javadoc.io/doc/io.github.data-rocks-team/schemaregistry-junit4) | [![Known Vulnerabilities](https://snyk.io/test/github/data-rocks-team/schemaregistry-junit/badge.svg?targetFile=schemaregistry-junit4/build.gradle)](https://snyk.io/test/github/data-rocks-team/schemaregistry-junit?targetFile=schemaregistry-junit4/build.gradle)
| [schemaregistry-junit-core](https://mvnrepository.com/artifact/io.github.data-rocks-team/schemaregistry-junit-core) | [![Maven Central](https://img.shields.io/maven-central/v/io.github.data-rocks-team/schemaregistry-junit-core.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.github.data-rocks-team%20a%3Aschemaregistry-junit-core) | [![Javadocs](http://www.javadoc.io/badge/io.github.data-rocks-team/schemaregistry-junit-core.svg)](http://www.javadoc.io/doc/io.github.data-rocks-team/schemaregistry-junit-core) | [![Known Vulnerabilities](https://snyk.io/test/github/data-rocks-team/schemaregistry-junit/badge.svg?targetFile=schemaregistry-junit-core/build.gradle)](https://snyk.io/test/github/data-rocks-team/schemaregistry-junit?targetFile=schemaregistry-junit-core/build.gradle) |

Wrapping [Confluent Schema Registry](https://docs.confluent.io/current/schema-registry/),
**schemaregistry-junit** allows developers to create and run integration tests using
[JUnit](https://junit.org/) against a "real"
[SchemaRegistry](https://github.com/confluentinc/schema-registry) service running within the test
context. No need to start up an external deployment! Not even a Docker container! Everything runs
in memory, making tests faster and shorten the feedback loop.
Are you tired of waiting for [Docker](https://www.docker.com/) containers to fire up while testing
your Kafka solution? Or are you tired of waiting for an ephemeral environment to start? Are you
looking for a solution to reduce the time you are loosing waiting for
[Apache Kafka Cluster](https://kafka.apache.org/) and
[Confluent Schema Registry](https://docs.confluent.io/current/schema-registry/) to start while
testing?
*schemaregistry-junit* is the answer! By pairing *schemaregistry-junit* together with
[kafka-junit](https://github.com/salesforce/kafka-junit), you can speed up your tests and shorten
the feedback loop by reducing the time wasted waiting for Docker containers or ephemeral
environments to start.
*schemaregistry-junit* lets you run a fully working
[Confluent Schema Registry](https://docs.confluent.io/current/schema-registry/) in-memory. The
server lifecycle is fully automated via [JUnit](https://junit.org/junit5/) extensions.
A fluent DSL is provided to configure the Confluent Schema Registry.

This project was inspired by [kafka-junit](https://github.com/salesforce/kafka-junit).

## Features
- Support for JUnit 4 and JUnit 5
- Support all SchemaRegistry version from 4.0.0 to the latest
- Support all [Confluent SchemaRegistry](https://mvnrepository.com/artifact/io.confluent/kafka-schema-registry?repo=confluent-packages)
version from 4.0.0 to the latest

## Installation
The easiest way is to include it in your project(s) by ways of a Maven dependency. Binary, Sources
Expand All @@ -47,12 +56,22 @@ For JUnit 4
</dependency>
```

## How it works
Given a class using `SharedSchemaRegistryTestResource`, before all tests start,
[JUnit](https://junit.org/junit5/) calls the start function. This function replicates the behaviour
of [SchemaRegistryMain.java](https://github.com/confluentinc/schema-registry/blob/master/core/src/main/java/io/confluent/kafka/schemaregistry/rest/SchemaRegistryMain.java),
which first validates the settings and then starts the server. When all tests have been executed,
independently of the test results, JUnit calls the shutdown function, which will shut the server
down.
Logs generated by the server are redirected to the terminal.

## Regression testing
Every build is automatically tested against the latest patch version of every minor version since 4.0.0. For more
details, check [schemaregistry-junit-regression-test](/schemaregistry-junit-test/schemaregistry-junit-regression-test).
Every build is automatically tested against the latest patch version of every minor version since
4.0.0. For more details, check
[schemaregistry-junit-regression-test](/schemaregistry-junit-test/schemaregistry-junit-regression-test).

## Examples
- [Junit 5 example](/examples/junit-5)
- [JUnit 5 example](/examples/junit-5)

## Contributing
Found a bug? Think you've got an awesome feature you want to add? We welcome contributions!
Expand Down

0 comments on commit 37b5b88

Please sign in to comment.