Skip to content
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

Consumer is null when using ConsumerVersionSelector #1244

Closed
anddreiu opened this issue Nov 11, 2020 · 3 comments
Closed

Consumer is null when using ConsumerVersionSelector #1244

anddreiu opened this issue Nov 11, 2020 · 3 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@anddreiu
Copy link

I have an issue when using tags on my pact files. I am using pact jvm 4.1.10, Pact Broker 2.68.1 and I am using JUnit to run the Provider tests. I am trying to use tags to retrieve the correct pact file when running the Provider tests for a specific consumer.
So I've applied the below consumerVersionSelectors:

@PactBroker(consumerVersionSelectors = { @VersionSelector(tag = "prod", consumer = "consumerName") }

Unfortunately, the pact file retrieved is the latest one published in Pact Broker and it looks like it does not see the consumer that I've indicated above. Also the retrieved pact file does not have prod tag.

2020-11-11 06:39:28.637 DEBUG [PactBrokerLoader.kt] Loading pacts from pact broker for provider providerName and consumer version selectors [ConsumerVersionSelector(tag=prod, latest=true, consumer=null, fallbackTag=)]
Verifying a pact between consumerName and providerName
  Notices:
    1) The pact at https://pactbroker/pacts/provider/providerName/consumer/consumerName/pact-version/64fr34ca943bbg242432we3f9hwe43c34r25wef2 is being verified because it matches the following configured selection criterion: latest pact for a consumer version tagged 'prod'

As @uglyog mentioned on slack, it looks like a defect because the consumer is null:

[ConsumerVersionSelector(tag=prod, latest=true, consumer=null, fallbackTag=)]

Thank you

@anddreiu
Copy link
Author

I've just tried to use the deprecated version of this:

@PactBroker(consumers = "consumerName", tags = "prod"

In this case the right consumer is taken (see below), but the retrieved pact is not the correct one:

2020-11-11 09:08:24.084 DEBUG [PactBrokerLoader.kt] Loading pacts from pact broker for provider providerName and consumerName version selectors [ConsumerVersionSelector(tag=prod, latest=true, consumer=consumerName, fallbackTag=null)]

The retrieved pact is the latest one, even if this does not have 'prod' tag. Very weird

@uglyog uglyog added the bug Indicates an unexpected problem or unintended behavior label Nov 15, 2020
@uglyog
Copy link
Member

uglyog commented Nov 15, 2020

4.1.11 has been released

@anddreiu
Copy link
Author

Thanks @uglyog. This looks to be fixed now, but I think there is another issue because I am still not able to select the correct Pact file using tags. I've raised another issue for that: #1249.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants