Support random actuator port in SpringBootTest

This commit changes @SpringBootTest(randomPort = true) to
generate a random port for the actuator endpoints if the
management server runs on a different port from the main
server.

Closes gh-4424
This commit is contained in:
Madhura Bhave
2018-09-07 10:31:49 -07:00
parent 01e61d88e7
commit d5a197fe66
4 changed files with 234 additions and 0 deletions

View File

@@ -6491,6 +6491,10 @@ test method by default. However, as using this arrangement with either `RANDOM_P
run in separate threads and, thus, in separate transactions. Any transaction initiated on
the server does not roll back in this case.
NOTE: `@SpringBootTest` with `webEnvironment = WebEnvironment.RANDOM_PORT` will also
start the management server on a separate random port if your application uses a different
port for the management server.
[[boot-features-testing-spring-boot-applications-detecting-web-app-type]]