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

PactBroker and IgnoreNoPactsToVerify #1337

Closed
ralfovelgoenne opened this issue Apr 9, 2021 · 4 comments
Closed

PactBroker and IgnoreNoPactsToVerify #1337

ralfovelgoenne opened this issue Apr 9, 2021 · 4 comments

Comments

@ralfovelgoenne
Copy link

I set up a test requesting PACTs from PactBroker. Everything works fine if the PACT Broker is up and running. By using the PACT Broker the tests are depending on a running PACT Broker and a valid connection to it. I want to prevent that if the PACT Broker is temporarily down or the developer does not have a valid connection to it the build breaks locally.
Therefore I used @IgnoreNoPactsToVerify in the test.
But if the connection fails the tests do fail by:
2021-04-09
08:08:56 SEVERE au.com.dius.pact.core.pactbroker.HalClient Failed to fetch the root HAL document
java.net.UnknownHostException: pact-broker.net

Is there are way to ignore this in case the connection fails to PACT Broker?

The header of my test class:
@RunWith(PactRunner.class)
@Provider("TestApp")
@IgnoreNoPactsToVerify(ignoreIoErrors = "true")
@PactBroker(host="pact-broker.net", port = "80", authentication = @PactBrokerAuth(username = "test", password = "test"))
public class ExamplePactTest extends JerseyTest {
..

@uglyog
Copy link
Member

uglyog commented Apr 10, 2021

What version of Pact-JVM are you using?

@ralfovelgoenne
Copy link
Author

ralfovelgoenne commented Apr 10, 2021

I am using 4.1.15. I did also try with latest 4.1.19, same result. 4.2.x seems not to be available for Java 8 (I am still stuck to it).

@uglyog
Copy link
Member

uglyog commented Apr 11, 2021

4.1.20 has been released

@ralfovelgoenne
Copy link
Author

Thanks for that, it works for me. Greetings to Melbourne.

@uglyog uglyog closed this as completed Apr 11, 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

2 participants