-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provider is not evaluating expression for 'application/x-thrift' protocol in 4.2.2 version #1330
Comments
With the change applied to fix #1314 you can now set the type for the content type with the See https://github.com/pact-foundation/pact-jvm/blob/master/provider/junit5/src/test/groovy/au/com/dius/pact/provider/junit5/ThriftStateInjectedProviderTest.groovy#L38 for an example. |
Thanks Ronald. |
@keeping-it-up can you have a look at the test I posted above, that works when I run it. |
@uglyog, I have run the test your referenced and it works. If I remove header part from request section of json file:
then it starts to work. Thanks. |
PR has been merged |
thanks @uglyog, can you let me know if you have done a release and release number please? thanks. |
4.2.5 has been released |
Works now, cheers. |
With 4.2.2 version of pact, noticed that provider is not evaluating expression for 'application/x-thrift' protocol.
To provide background info, we pushed a PR as part of issue #1298 which allows to use json matcher for application/x-thrift protocol. In version 4.1.17 this change was working fine and expression were evaluating properly - getting value from state method.
In another issue #1318, array matching issue related to arrayContaining() was fixed in version 4.2.2.
However after upgrading pact version to 4.2.2, we have noticed that expressions are not getting value from state method for 'application/x-thrift' protocol.
With application/json or application/x-thrift+json protocol, expressions are fine.
I can see that json matcher is being used for 'application/x-thrift' protocol so code for issue 1298 is being merged into 4.2.2 (i can also verify this in git 4.2.x branch).
In terms of debug, I can see that invokeStateChangeMethods() function of PactVerificationStateChangeExtension calls my state method which sets expression value into map, then in beforeTestExecution() function provider state is set to testContext:
testContext.executionContext = mapOf("providerState" to providerStateContext)
after that when flow comes to context.verifyInteraction(); method of my provider test class, i can see request still having example parameter set by consumer instead of provider's state method parameter.
Logs also say that state method is invoked:
The text was updated successfully, but these errors were encountered: