How to do additional checks on the provider response?
See original GitHub issueHi,
this is a question.
I wanted to introduce some additional testing to the pact after the response has been retrieved.
As far as I understand, the way to do it is to implement the interface au.com.dius.pact.provider.junit.target.Target
.
Since there is a default implementation HttpTarget
, I’ve extended it and overridden the method testInteraction
. What I would actually want to do is receive the response based on the contract specification and do some additional checks (e.g. apply jsonschema validation).
How am I supposed to do it without rewriting the logic to make the right call for a second time in my override?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Consent configuration - Tag Manager Help
In any web tag, click Advanced Settings > Consent Settings. · Review settings listed in Built-In Consent Checks. Tags with built-in consent checks...
Read more >Rap Sheets (Identity History Summary Checks) - FBI
If you need additional sealed responses mailed to the same address or different addresses, send additional requests with another payment of $18 for...
Read more >Data Breach Response: A Guide for Business
Mobilize your breach response team right away to prevent additional data loss. The exact steps to take depend on the nature of the...
Read more >Medicare Telemedicine Health Care Provider Fact Sheet - CMS
The practitioner may respond to the patient's concern by telephone, audio/video, secure text messaging, email, or use of a patient portal.
Read more >Submit a complaint | Consumer Financial Protection Bureau
If we can't send your complaint to the company for response, we'll send it to another federal agency and let you know. Consistent...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There are a few different ways of achieving this. We could have a callback mechanism similar to the state change methods. That way you could just provide an annotated method on your test class that receives the response data.
Returning a collection of validation failures would be better. Handling exceptions would work, but it only allows for reporting one failure.