Test server port shouldn't affect management port when random

Closes gh-16108
This commit is contained in:
Dmytro Nosan
2019-03-06 11:36:06 +02:00
committed by Madhura Bhave
parent 07d95ce086
commit 2f3e5d65be
2 changed files with 14 additions and 2 deletions

View File

@@ -52,7 +52,8 @@ class SpringBootTestRandomPortEnvironmentPostProcessor
}
Integer managementPort = getPropertyAsInteger(environment,
MANAGEMENT_PORT_PROPERTY, null);
if (managementPort == null || managementPort.equals(-1)) {
if (managementPort == null || managementPort.equals(-1)
|| managementPort.equals(0)) {
return;
}
Integer serverPort = getPropertyAsInteger(environment, SERVER_PORT_PROPERTY,