pact-foundation / pact-mock_service

Provides a mock service for use with Pact
https://pact.io
MIT License
73 stars 69 forks source link

Release 2.9.8 loses pactSpecification #93

Closed mattermack closed 4 weeks ago

mattermack commented 6 years ago

Through the pact-mock-service.bat with the below versions, the pactSpecification in /pact is populated

App Version Working (y/n)
pact 1.53.0 n
pact-mock_service gem 2.9.8 n
pact 1.52.2 y
pact-mock_service gem 2.9.3 y

To replicate, run the following command on pact-1.53.0: ``"pact-mock-service.bat" service --consumer=someConsumer --provider=someProvider --pact-dir=.\example\output --pact-file-write-mode=overwrite --host=localhost --port=7200 --pact-specification-version=2.0.0

Then open up PostMan or make the following CURL posts:

`I, [2018-08-14T11:26:46.489303 #16280] INFO -- : Registered expected interaction GET /6/categories D, [2018-08-14T11:26:46.489303 #16280] DEBUG -- : { "description": "General Meetup Categories 6", "providerState": "A GET request to return JSON using Meetups category api under version 2 6", "request": { "method": "GET", "path": "/6/categories", "headers": { "Content-Type": "application/json" } }, "response": { "status": 200, "headers": { "Content-Type": "application/json" }, "body": { "results": { "name": "Games", "sort_name": "Games", "id": 11, "shortname": "Games" } } } }```

There results missing version 2.0.0


I, [2018-08-14T11:27:03.426626 #16280]  INFO -- : Verifying - interactions matched
I, [2018-08-14T11:27:40.132247 #16280]  INFO -- : Writing pact for someProvider to ./example/output/someconsumer-someprovider.json... from someconsumer-someprovider.json{
   "consumer": {
       "name": "someConsumer"
   },
   "provider": {
       "name": "someProvider"
   },
   "interactions": [
       {
           "description": "General Meetup Categories 6",
           "providerState": "A GET request to return JSON using Meetups category api under version 2 6",
           "request": {
               "method": "GET",
               "path": "/6/categories",
               "headers": {
                   "Content-Type": "application/json"
               }
           },
           "response": {
               "status": 200,
               "headers": {
                   "Content-Type": "application/json"
               },
               "body": {
                   "results": {
                       "name": "Games",
                       "sort_name": "Games",
                       "id": 11,
                       "shortname": "Games"
                   }
               }
           }
       }
   ],
   "metadata": {
       "pactSpecification": {
           "version": "0.0.0"
       }
   }
}```

Notice how we submitted 2.0.0 into the command but got out "0.0.0"
bethesque commented 6 years ago

Thanks for finding that. Please try 1.54.4.