Hi There, I am writing the pact provider test on t...
# pact-jvm
p
Hi There, I am writing the pact provider test on the application running with Spring and Junit 4. I am using the au.com.dius.pact.provider dependenc and came across 2 questions and it will be really appreciated anyone can guide on this 1. What I understand from the documentation is while doing provider testing we need to test against the actual server in test. And I am using a docker container hosted with application and hitting the pact provider test against the application in testing container. The situation I came across is the base url("127.0.0.1"), port (443) and protocol (https) can vary and I need this values to be passed from some environment variables in the CI pipeline. Can anyone guide on this
Copy code
@TestTarget
public final Target target = new HttpTarget("https", "127.0.0.1", 443, "api", true);
2. I have a job in the pipeline which build the application by running the "mvn clean install" command . The provider test also runs in this scenario and as the environment is not ready it will fail the test and build will not succeed. I want to control the running of pact provider test only when invoked individually in a job for pact provider testing. In all the other cases if anyone invoke the command "mvn clean install" pact provider test cases should not run. How to handle this situation. Thanks in advance for the help and guidance