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.

Is there anyway to configure RedirectHandling in Pact-Net similar to Pact JVM

See original GitHub issue

I see there is a configuration to enable/ disable RedirectHandling pact.verifier.enableRedirectHandling for Provider Verification in Pact JVM. Wondering, if there is similar configuration is Pact Net. Currently, i observe Pact Net verifier tries to handle the redirection when there is 301 status. Wondering, if we can disable such behaviour.

Using PactNet Version=“4.3.0”

From Pact JVM docs: Screenshot 2023-01-27 at 17 44 03

Issue Analytics

  • State:open
  • Created 8 months ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
adamrodgercommented, Jan 30, 2023

Currently there’s no way to configure this, no.

0reactions
TimothyJonescommented, Feb 15, 2023

Sorry, I think I wasn’t clear above- I’m advocating not putting the redirect in the contract- since the behaviour you want a contract for (usually) isn’t “redirect the client”, it’s “get a response in the following format”.

Whether or not there is a redirect on the way to that response is an implementation detail.

The same argument applies to the URL- probably the specific URL is an implementation detail, and not something the client is relying on.

Remember that the contract is for recording the behaviour the client relies on, not the behaviour of the provider. Unless the client needs the redirect as part of its logic (which is possible, but unlikely) it’s best to have it invisible from the perspective of the consumer test.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · pact-foundation/pact-net
Enables consumer driven contract testing, providing a mock service and DSL ... Is there anyway to configure RedirectHandling in Pact-Net similar to Pact...
Read more >
Can I create a PACT to run on a different hostname?
It is possible to do (there are standalone mock servers you can run on another machine), but the PactProviderRule always starts a mock...
Read more >
Changelog | Pact Docs
4.3.4 - Support branches when publishing Pacts​ · 048fc2a73 - update changelog for release 4.2. · 101b34ecb - update changelog for release 4.1....
Read more >
Contract Testing with Pact.NET - YouTube
In this video we will discuss working with Contract testing using Pact.NET This video is extracted from EA Weekly here ...
Read more >
Getting started with Pact and Consumer Driven Contract Testing
So you heard about Pact and want to get started with contract testing? This guide should hopefully get you going in the right...
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