Nitek Nitek - 1 year ago 116
Java Question

Use Pact and JUnit to test SSL secured API

I am trying to implement pact tests between two of our server systems, but unfortunately I am struggling with implementing the consumer tests:
I included the pact-jvm-consumer-junit_2.11 artifact and created a provided like this using a @Rule:

public PactProviderRule mockProvider = new PactProviderRule("test_provider", "localhost", PORT, this);

Unfortunately (for the tests at least) our client is hardcoded to use a SSL connection. Therefore our tests fail because the pact server does not allow SSL connections. Is there a way to tell pact to do so or work around this without the need for setting up a external reverse proxy server?

Answer Source

Turns out it wasn't really supported yet. I created a feature request, which was already implemented:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download