Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README with instructions on how to run contract test using docker #1

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,29 @@ Upon receiving a message, the consumer processes it and publishes a new message
```shell
./gradlew clean test
```

## Run the contract tests using specmatic-kafka docker image

1. Start the kafka broker using Specmatic's Kafka Mock. [Note - You can use any kafka broker other than this too.]
```shell
docker run -p 9092:9092 -p 2181:2181 -p 29092:29092 -v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" znsio/specmatic-kafka-trial virtualize
```
2. Run the application.
```shell
./gradlew bootRun
```
3. Run the contract tests.
```shell
docker run --network="host" -v "$PWD/specmatic.yaml:/usr/src/app/specmatic.yaml" -v "$PWD/src/test/resources:/usr/src/app/examples" znsio/specmatic-kafka-trial test --examples-dir=examples
```

## Get information around other CLI args exposed by specmatic-kafka docker image

1. To get information around all the CLI args of the `virtualize` command, run the following.
```shell
docker run znsio/specmatic-kafka-trial virtualize --help
```
2. To get information around all the CLI args of the `test` command, run the following.
```shell
docker run znsio/specmatic-kafka-trial test --help
```