Example project to test producer-consumer Kafka Streams using Spock Framework with Groovy.
KafkaStreamsTesting
├── src
│ ├── main
│ ├── groovy/com/example/testautomation
│ ├── helpers
│ ├── test
│ ├── groovy/com/example/testautomation
│ ├── PublishSubscribeRecordSpec
1. Build:
$ gradle build
2. Run Tests:
$ gradle -Dtest.single=PublishSubscribeRecordSpec test
1. Pull spotify/kafka:
$ docker pull spotify/kafka
2. Run Container:
$ docker run -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=0.0.0.0 --env ADVERTISED_PORT=9092 spotify/kafka
2. Open Container Bash:
$ docker exec -it <container_id> /bin/bash