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

Unable to set up the full URL to pact-broker #1282

Closed
piotrsoltysiak opened this issue Dec 31, 2020 · 2 comments
Closed

Unable to set up the full URL to pact-broker #1282

piotrsoltysiak opened this issue Dec 31, 2020 · 2 comments

Comments

@piotrsoltysiak
Copy link

Hi all!
I have the broker up and running on non-root path on API-gateway (https://api.gw.url/path/to/broker). To set it up on the contract tests, I am using the @PactBroker annotation:

@PactBroker(host = "api.gw.url/path/to/broker", scheme = "https", port = "443",
        authentication = @PactBrokerAuth(username = "username", password = "password"))

But with this config, error occurs:

java.lang.IllegalArgumentException: Invalid pact broker host specified ('api.gw.url/path/to/broker'). Please provide a valid host or specify the system property 'pactbroker.host'.

This error does not occur when I change the URL to connect the broker directly (without the gateway, to the root path), but for some reasons I have to use the gateway endpoint.
Is there a way to provide the full URL of the broker?

Cheers!

@LibenziPascal
Copy link

Hello, I am facing the same issue than @piotrsoltysiak.

I am currently looking for a workaround, but it seems that the only thing I can do for now is to rewrite classes PactBrokerLoader and PactJUnit5VerificationProvider in my own project, since we cannot override methods of these classes...
Is there a workaround to get a "path" param in the pact-broker url, or does anybody know when it could be improved?

Many thanks!

@uglyog
Copy link
Member

uglyog commented Jul 31, 2021

As of 4.1.19/4.2.2 you can use @PactBroker(url = "https://api.gw.url/path/to/broker", authentication = @PactBrokerAuth(username = "username", password = "password"))

@uglyog uglyog closed this as completed Jul 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants