pact-jvm icon indicating copy to clipboard operation
pact-jvm copied to clipboard

Enhance Unexpected request error message format

Open SergeyPirogov opened this issue 3 years ago • 3 comments

Hello, would be nice to make Unexpected request error message format better, readable to get better understanding why is it not matched

Response. Status code: 500, body: { "error": "Unexpected request : \tmethod: POST\n\tpath: \/extresinventory\/api\/v1\/api\/locality\/all\n\tquery: {}\n\theaders: {Accept-encoding=[gzip,deflate], Accept=[application\/json, application\/*+json], Connection=[Keep-Alive], Host=[localhost:9999], User-agent=[Apache-HttpClient\/4.5.11 (Java\/11.0.10)], Content-type=[application\/json], Content-length=[133]}\n\tmatchers: MatchingRules(rules={})\n\tgenerators: Generators(categories={})\n\tbody: PRESENT({\"id\":\"0b775ded-44bf-4231-a805-cca92c5967fc\",\"params\":{\"resource\":{\"id\":\"0\"},\"host\":\"http:\/\/localhost:9999\/extresinventory\/api\/v1\/\"}})" }

I could try to provide a PR for this, but I need help to find the place where this check is performed

SergeyPirogov avatar Dec 28 '21 09:12 SergeyPirogov

Have you looked at the reporters for this?

mefellows avatar Dec 28 '21 11:12 mefellows

@mefellows no, could you please point me to the right place?

SergeyPirogov avatar Dec 28 '21 14:12 SergeyPirogov

https://docs.pact.io/implementation_guides/jvm/provider/junit/#enabling-additional-reports-via-annotations-on-the-test-classes

mefellows avatar Jan 02 '22 03:01 mefellows