79148800

Date: 2024-11-01 16:45:31
Score: 0.5
Natty:
Report link

It turns out that Spring Boot has property placeholder resolution which allows you to write tests like that:

@SpringBootTest(
  webEnvironment = WebEnvironment.RANDOM_PORT,
  properties = {"rest.clients.echo.base-path=${wiremock.server.baseUrl}"}
)
class EchoServiceTest {
...

And you can even concatenate there other strings like this:

properties = {"rest.clients.echo.base-path=${wiremock.server.baseUrl}/something/else"}
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: u4963840