Hello, have anyone tried passing the port number f...
# pact-jvm
j
Hello, have anyone tried passing the port number for the mock server as a command line argument when running consumer tests? Tried it but failing, may be I am missing something. Any thoughts? Thanks.
Copy code
@PactTestFor(providerName = "test-provider", port = "${pact.server.port}")
We would be setting the same port in one of our config yml file hence we would like to either set it via command line or read and pass it to our yml config similar to using @AutoConfigureWiremockPort which exposes the port via ${wiremock.server.port}
m
It doesn’t appear that you can inject those properties there. Can you not use the standard approach here: https://docs.pact.io/implementation_guides/jvm/consumer/junit5#injecting-the-mock-server-into-the-test
j
Thanks, unfortunately this won't work for as we load the properties file well before this where we use the pact mock server URL too.
m
can you override the API client URL at runtime?
j
Good question, need to check this.
đź‘Ť 1
m
That’s how most people do it. This allows you to run multiple consumer tests in parallel. If you share the same point, you have to run them in serial
It also is configless then