Ronny Bräunlich
unread,Mar 18, 2022, 6:10:35 AM3/18/22Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to wiremock-user
Hey everyone,
in some of my tests I use the @WireMockTest annotation and pass the port from the WireMockRuntimeInfo to the class being tested.
Nevertheless, this only works when I can pass in the port/url into the class. When using e.g. a SpringBootTest with Dependency Injection it's sometimes not possible.
Therefore, I wanted to ask here, what people think about exposing the (random) port as system property. So by using a well known property I'd be able to use it as a placeholder in my Spring test configuration. Basically, adding something like:
System.setProperty("wiremock.server.port", wireMockServer.port().toString())
to the WireMockExtension. Any opinions on this?
Cheers,
Ronny