Add LocalManagementPort

Add an annotation alias for the actual management port, similar to what
was done for the main context (`LocalServerPort`).

See gh-5548
This commit is contained in:
Stephane Nicoll
2016-04-15 14:02:38 +02:00
parent a4f77ae275
commit f364d713dd
6 changed files with 51 additions and 10 deletions

View File

@@ -22,7 +22,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.autoconfigure.LocalManagementPort;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.boot.context.web.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
@@ -53,7 +53,7 @@ public class InsecureManagementPortAndPathSampleActuatorApplicationTests {
@LocalServerPort
private int port = 9010;
@Value("${local.management.port}")
@LocalManagementPort
private int managementPort = 9011;
@Test

View File

@@ -21,7 +21,7 @@ import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.autoconfigure.LocalManagementPort;
import org.springframework.boot.context.web.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
@@ -48,7 +48,7 @@ public class ManagementAddressActuatorApplicationTests {
@LocalServerPort
private int port = 9010;
@Value("${local.management.port}")
@LocalManagementPort
private int managementPort = 9011;
@Test

View File

@@ -22,7 +22,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.autoconfigure.LocalManagementPort;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.boot.context.web.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
@@ -52,7 +52,7 @@ public class ManagementPortAndPathSampleActuatorApplicationTests {
@LocalServerPort
private int port = 9010;
@Value("${local.management.port}")
@LocalManagementPort
private int managementPort = 9011;
@Test

View File

@@ -22,7 +22,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.actuate.autoconfigure.LocalManagementPort;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.boot.context.web.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
@@ -52,7 +52,7 @@ public class ManagementPortSampleActuatorApplicationTests {
@LocalServerPort
private int port = 9010;
@Value("${local.management.port}")
@LocalManagementPort
private int managementPort = 9011;
@Test