The Pact contracts in this directory would generally NOT be checked into source control like this. Instead, they would likely be pushed to a Pact Broker and then automatically discovered in the provider verification tests.
One of the main goals of the Superheroes application is to be super simple and just "work" by anyone who may clone this repo. That being said, we can't make any assumptions about where a Pact broker may be or any of the credentials required to access it.
It would be simple enough to modify ContractVerificationTests.kt
to use a Pact broker:
- Remove the
@PactFolder("pacts")
annotation - Remove the
@EnabledIfSystemProperty
annotation- This is only here because, currently, pact contract verification does not work in Quarkus dev mode/continuous testing, but does work if running the Maven's ```test
/
verify` goals.
- This is only here because, currently, pact contract verification does not work in Quarkus dev mode/continuous testing, but does work if running the Maven's ```test
- Place a
@PactBroker
annotation with aurl
parameter containing the location of the Pact broker. - When you run the tests, specify the
pactbroker.auth.token
property so that the test can authenticate with the broker. - Optionally, you could also add an
@EnabledIfSystemProperty(named = "pactbroker.auth.token", matches = ".+", disabledReason = "pactbroker.auth.token system property not set")
annotation.- This would make sure that the verification tests ONLY ran if the
pactbroker.auth.token
property was set. - If you run the verification tests and don't provide the token, the tests will fail.
- This would make sure that the verification tests ONLY ran if the