Kushagra Kapoor

06/13/2023, 11:43 AM
Hello, Can someone please help me with the dynamic port usage? I wrote a wiremock test using @WiremockTest annotation. Wiremock server is coming up on a default port. I am able to call my service from the test but I am not able to understand how do I modify the wiremock's dynamic port on the fly in the service, so that service makes the third party service call to wiremock instead of actual third party service. I am blocked on this. Request the team to help. P.S. - Intent is to run each wiremock test class with a separate wiremock server on dynamic port against the service.
@Tom Can you please help here? In one of the post I saw the usage of @DynamicPropertySource to override the remote url from test. But this annotation is specific to spring, is this the only way to do it or does wiremock provides out of the box support for this? Ref: 1. 2.