fallbackTag doesn't work and code throws NoPactsFoundException

432 views Asked by At

I am using 4.1.11 version of junit5 provider.

<dependency>
  <groupId>au.com.dius.pact.provider</groupId>
  <artifactId>junit5</artifactId>
  <version>4.1.11</version>
</dependency>

As per the documentation, I am specifying both tag and fallbackTag in my provider test class.

consumerVersionSelectors = {
                @VersionSelector(tag = "branch123", fallbackTag = "master")
        }

Now its supposed to use master tag contract if branch123 tag contract doesn't exist. However it doesn't work me and throws following error:

au.com.dius.pact.provider.junitsupport.loader.NoPactsFoundException: No Pact files were found to verify

I can confirm that master tag does exist from pact broker as well as using that in tag field and running the test successfully.

Is this a bug in library? Or am I missing anything?

Looking at code of VersionSelector, it seems that does have fallbackTag() method, however when I go into PactBroker, consumerVersionSelectors() method doesn't seem to have any reference of fallbackTag:

https://github.com/pact-foundation/pact-jvm/blob/4_1_11/provider/src/main/java/au/com/dius/pact/provider/junitsupport/loader/VersionSelector.java

https://github.com/pact-foundation/pact-jvm/blob/4_1_11/provider/src/main/java/au/com/dius/pact/provider/junitsupport/loader/PactBroker.java

Thanks.

1

There are 1 answers

0
Matthew Fellows On

It looks and sounds like a bug - could you please raise it on the Pact JVM issues register?