Hi, I try to use Pact broker consumerVersionSelect...
# pact-jvm
m
Hi, I try to use Pact broker consumerVersionSelectors in kotlin. Seems its not working
Copy code
@PactBroker(
        authentication= @PactBrokerAuth(username = "", password = ""),
        port="8080",
        consumerVersionSelectors={ @VersionSelector(latest = "true") }
)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class PactCPEProviderTest {
I take it from Docs https://docs.pact.io/pact_broker/advanced_topics/consumer_version_selectors/ But compiler argues on VersionSelector with An annotation can't be used as the annotations argument Is it possible to solve it somehow?
p
I just tried an example from the docs and it works fine:
Copy code
@Provider("my provider name")
@PactBroker(host = "${PACT_BROKER_HOST}",
        authentication = @PactBrokerAuth(username = "${PACT_BROKER_USERNAME}", password = "${PACT_BROKER_PASSWORD}"),
        consumerVersionSelectors = {
                @VersionSelector(tag = "master"),
                @VersionSelector(tag = "dev"),
                @VersionSelector(tag = "production")
        }
)
I’m using
Copy code
<dependency>
          <groupId>au.com.dius.pact.provider</groupId>
          <artifactId>junit5</artifactId>
          <version>4.1.17</version>
          <scope>test</scope>
        </dependency>
m
Do you use kotlin?
p
no, I use java 11 (zulu build)
m
that's the reason, thanks for sharing
Copy code
@PactBroker(
        authentication= PactBrokerAuth(username = "", password = ""),
        consumerVersionSelectors=[ VersionSelector(latest = "true") ]
)
Seems it should looks like that in kotlin