Hi All. I have a question on the pact broker confi...
# general
x
Hi All. I have a question on the pact broker config. Everything works fine if I have this annotation used on the provider verification test class. @PactBroker(scheme = "https", host = "company.test.stp.hmlr.zone", port = "443"). But if I changed it to @PactBroker and add config on my build.gradle.
Copy code
pact {
    broker {
        pactBrokerUrl = '<https://company.test.stp.hmlr.zone/>'
    }
the pact broker won't be found. Not sure why it does not work. Please help. Thank you.
u
@PactBroker
annotation does not work with the config in the Gradle build file, that is only used by the Gradle plugin. You can use system properties with that annotation. Refer to https://github.com/pact-foundation/pact-jvm/tree/master/provider/junit#using-java-system-properties but also take note of https://github.com/pact-foundation/pact-jvm/tree/master/provider/junit5#important-note-jvm-system-properties[…]build-is-running-with-gradle-or-maven
x
Thanks. @uglyog Now I set system properties for pact broker. It works fine. However, the provider's branch name does not show anymore on the pact broker UI. I have these config on build.gradle.
Copy code
serviceProviders {
        fromPactBroker {
            withSelectors {
                branch('poc-contract-testing') 
            }
        }
    }
Please give some suggestions. Many thanks.
u
Use
pact.provider.branch
to set the branch
👍 1
x
Thanks.