Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lensesio/kafka-testing
Repository for advanced unit-testing with embedded kafka services
https://github.com/lensesio/kafka-testing
kafka testing
Last synced: about 2 months ago
JSON representation
Repository for advanced unit-testing with embedded kafka services
- Host: GitHub
- URL: https://github.com/lensesio/kafka-testing
- Owner: lensesio
- License: apache-2.0
- Archived: true
- Created: 2017-04-11T10:32:34.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-03T15:02:30.000Z (about 6 years ago)
- Last Synced: 2024-05-18T22:21:21.389Z (8 months ago)
- Topics: kafka, testing
- Language: Scala
- Size: 32.2 KB
- Stars: 25
- Watchers: 5
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-kafka - Unit-testing for embedded kafka services
README
[![Build Status](https://travis-ci.org/Landoop/kafka-testing.svg?branch=master)](https://travis-ci.org/Landoop/kafka-testing)
[](http://search.maven.org/#search%7Cga%7C1%7Ckafka-testing_2.11)
[](http://search.maven.org/#search%7Cga%7C1%7Ckafka-testing_2.12)# Kafka Unit Testing
Allows you to start and stop for unit testing applications that communicate with Kafka `one or more Kafka brokers + a ZooKeeper instance + a Schema Registry instance + a Kafka Connect instance`
## Versions
| kafka-testing | Kafka broker | Zookeeper | Schema Registry | Kafka Connect |
|---------------|---------------------------|-----------| ----------------| --------------|
| 0.1 | kafka_2.11 : 0.10.2.0 | 3.4.6 | 3.2.0 | 3.2.0 |
| 0.2 | kafka_2.11 : 0.10.2.1-cp2 | 3.4.6 | 3.2.2 | 3.2.2 |
| 0.2 | kafka_2.12 : 0.10.2.1 | 3.4.6 | 3.2.2 | 3.2.2 |
| 2.1 | 1.1 | 3.4.6 | 4.1.0 | 1.1.0 |## Maven central
```xml
com.landoop
kafka-testing_2.11
2.1```
```gradle
compile 'com.landoop:kafka-testing_2.11:2.1```
```sbt
libraryDependencies += "com.landoop" %% "kafka-testing" % "2.1"
```### Required additional dependencies
This library requires Apache Kafka test-jars within the scope (requirement of KCluster)
```sbt
libraryDependencies ++= Seq(
"org.apache.kafka" %% "kafka" % "1.1.0" % Compile classifier "test",
"org.apache.kafka" %% "kafka" % "1.1.0" % Compile,
"org.apache.kafka" % "kafka-clients" % "1.1.0" % Compile classifier "test",
"org.apache.kafka" % "kafka-clients" % "1.1.0" % Compile
)```## Using it
```scala
val kafkaCluster: KCluster = new KCluster()
//get kafka brokers
val brokers = kafkaCluster.BrokersList
//get schema registry client
val schemaRegistryClient = kafkaCluster.SchemaRegistryService.get.restClient
//get schema registry endpoint
val schemaRegistryEndpoint = kafkaCluster.SchemaRegistryService.get.Endpoint
//get Zookeeper Client
val zkClient = kafkaCluster.ZKClient
//start connect
kafkaCluster.startEmbeddedConnect(...)
```## License
```
Copyright 2017 LandoopLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```