Pact provider verification is not calling provider-states

746 Views Asked by At

I have followed the examples on https://github.com/pact-foundation/pact-net#verifying-a-provider using version 4.0.0. My problem is that tests are failing because the provider state is not being set up. In the logs I see no mention of the /provider-states url being called and when I debug, the only call to ProviderStateMiddleware.InvokeAsync is for the actual API call. I can prove my test is passing by forcing the provider state setup in the constructor.

1

There are 1 best solutions below

0
Landrew On

I found my issue. I was missing .Given(“some state”) in my consumer test.