From f6fe4f05367ded99961489d1632d9b382bf33e8e Mon Sep 17 00:00:00 2001 From: TrishaChetani Date: Thu, 4 Dec 2025 05:55:12 +0100 Subject: [PATCH] Modified the command for mac users --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 207a093..bc64471 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ The interaction between Order API in this project and it's consumers is governed 1. Spring Boot service written in Java 2. Specmatic 3. Docker Desktop (for running contract tests with containers) +4. openjdk version 17.0.17 ## Run Contract Tests Specmatic contract tests use the [specmatic.yaml](specmatic.yaml) configuration file to start the required Specmatic stub before verifying the Order API. @@ -39,6 +40,8 @@ mvnw.cmd test -Dtest=ContractTest After the tests complete, view the report at [build/reports/specmatic/html/index.html](build/reports/specmatic/html/index.html). #### Contract Tests Using TestContainers + +1. Start docker locally For **Unix based systems** and **Windows PowerShell**: ```shell @@ -63,7 +66,15 @@ For **Unix based systems** and **Windows PowerShell**: # Run the contract tests docker run --rm --network host -v "$(pwd)/specmatic.yaml:/usr/src/app/specmatic.yaml" -v "$(pwd)/build/reports/specmatic:/usr/src/app/build/reports/specmatic" specmatic/specmatic test --port=8090 ``` - +For mac user +```shell +docker run --rm \ + -v "$(pwd)/specmatic.yaml:/usr/src/app/specmatic.yaml" \ + -v "$(pwd)/build/reports/specmatic:/usr/src/app/build/reports/specmatic" \ + specmatic/specmatic test \ + --host=host.docker.internal \ + --port=8090 +``` For **Windows Command Prompt**: ```shell # Start the service