Skip to content

Commit

Permalink
Merge pull request #1 from znsio/update_readme_with_docker
Browse files Browse the repository at this point in the history
Update README with instructions on how to run contract test using docker
  • Loading branch information
harikrishnan83 authored Aug 6, 2024
2 parents 7b347d6 + 74cada4 commit 03097fd
Showing 1 changed file with 26 additions and 0 deletions.
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
```

0 comments on commit 03097fd

Please sign in to comment.