question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to do additional checks on the provider response?

See original GitHub issue

Hi,

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:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
uglyogcommented, Jun 17, 2018

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.

0reactions
uglyogcommented, Jun 17, 2018

Returning a collection of validation failures would be better. Handling exceptions would work, but it only allows for reporting one failure.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found