Hi All, I have added a header in my request now wa...
# pact-jvm
a
Hi All, I have added a header in my request now wanted to verify this in provider test. How do I make sure that response from the provider should be in "en-US" only ? "headers": { "Accept-Language": "en-US" } Thanks in advance. Getting the below error when trying to add in provider test -
Copy code
org.junit.jupiter.api.extension.ParameterResolutionException: No ParameterResolver registered for parameter [org.apache.http.HttpRequest request] in method [...pactVerificationTestTemplate(au.com.dius.pact.provider.junit5.PactVerificationContext,org.apache.http.HttpRequest)].
b
So, the Accept header is a consumer header, you don’t exactly verify that at the provider. If you want to be sure that the provider responds in a certain way when the Accept header doesn’t have the right value, make that an interaction. Or better, test that in the provider team, not with a contract test.
👌 1
☝️ 1
a
Ok got it. Thanks for the explanation.
👍 1
b
Sorry, I said Accept, but the same applies to the Accept-Language header. My bad.
👍 1
a
Yeah np thanks 🙂