You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Skipping publishing of verification results as it has been disabled (pact.verifier.publishResults is not 'true'
However, I have this in my testing applications.properties file:
# in my application.properties for testing
pact.verifier.publishResults=true
And I am using the PactVerificationSpringProvider junit extension - so I would expect my properties file to be used:
// my (very simplified) contract test runner class
@PactBroker(
url ="https://my-pact-broker.example.com",
consumerVersionSelectors = [VersionSelector(tag ="master")],
)
classMyContractTestRunner {
@TestTemplate
@ExtendWith(PactVerificationSpringProvider::class) // note that we use the spring providerfunpactVerificationTestTemplate(context:PactVerificationContext) {
context.verifyInteraction()
}
}
The fix (pretty sure)
In PactVerificationExtension we do not pass the ValueResolver in to the PactVerificationContext when we construct it - so it defaults to SystemPropertyResolver. One of the main functions of PactVerificationSpringProvider is to set up a SpringEnvironmentResolver instead of a SystemPropertyResolver so that spring property files are used.
The issue
I am seeing this in my logs:
However, I have this in my testing applications.properties file:
And I am using the
PactVerificationSpringProvider
junit extension - so I would expect my properties file to be used:The fix (pretty sure)
In
PactVerificationExtension
we do not pass theValueResolver
in to thePactVerificationContext
when we construct it - so it defaults toSystemPropertyResolver
. One of the main functions ofPactVerificationSpringProvider
is to set up aSpringEnvironmentResolver
instead of aSystemPropertyResolver
so that spring property files are used.I believe this can be fixed quite trivially i.e.
The text was updated successfully, but these errors were encountered: