Subrahmanyam Rentala
08/18/2022, 3:58 PM/Users/srentala/Desktop/Pact/pacts
{
"consumer": {
"name": "test-consumer"
},
"provider": {
"name": "test-provider"
},
"interactions": [
{
"description": "a request to get the machine IP",
"providerState": "a endpoint to get IP",
"request": {
"method": "GET",
"path": "/product"
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"ip": "81.96.249.131"
},
"matchingRules": {
"$.headers.Content-Type": {
"match": "regex",
"regex": "^application\\/json"
},
"$.body": {
"match": "type"
}
}
}
}
],
"metadata": {
"pactSpecification": {
"version": "2.0.0"
}
}
}
I am running the following command to create a mock server using Pact : pact-mock-service --consumer test-consumer --provider test-provider --port 1234 --pact-dir=/Users/srentala/Desktop/Pact/pacts
but on hitting the endpoint from Postman, it gives following “no interactions found” . What am I missing here?Yousaf Nabi (pactflow.io)
-d, [--pact-dir=PACT_DIR] # Directory to which the pacts will be written
If you are trying to load a pact file, to generate as a stub, you can use
https://github.com/pact-foundation/pact-mock_service#stub-service-usageYousaf Nabi (pactflow.io)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Subrahmanyam Rentala
08/22/2022, 4:53 PMSubrahmanyam Rentala
08/23/2022, 10:30 AMMatt (pactflow.io / pact-js / pact-go)
Subrahmanyam Rentala
08/23/2022, 1:54 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)