ITV / scala-pact

A Scala implementation of CDC using the Pact standard
Other
108 stars 54 forks source link

Log pactbroker error bodies #197

Closed dantb closed 3 years ago

dantb commented 3 years ago

Fixes https://github.com/ITV/scala-pact/issues/196

The specific 400 error mentioned here https://github.com/ITV/scala-pact/issues/71#issuecomment-723306849 can be reproduced with this curl

curl --location --request POST 'https://test.pact.dius.com.au/pacts/provider/scala-pact-provider/consumer/scala-pact-consumer/pact-version/56cd913906efe69e3f8b9fe9c62e69aac2b31aa8/verification-results' \
--header 'Accept: application/hal+json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic ZFhmbHR5Rk1nTk9GWkF4cjhpbzl3SjM3aVVwWTQyTTpPNUFJWld4ZWxXYkx2cU1kOFBrQVZ5Y0JKaDJQc3lnMQ==' \
--data-raw '{
  "success": true,
  "providerApplicationVersion": "",
  "buildUrl": "http://my-ci.org/build/3456"
}'

This now prints

Publish verification results failed. Failed with 400, {"errors":{"provider_version":["can't be blank","Version number '' cannot be parsed to a version number. The expected format (unless this configuration has been overridden) is a semantic version. eg. 1.3.0 or 2.0.4.rc1"]}}
jbwheatley commented 3 years ago

needs to run sbt scalafmtAll. Sorry, need to add that to the contributor instructions