Updates for boot 2.0 compatibility
This commit is contained in:
@@ -44,4 +44,4 @@ feignClient:
|
||||
localappName: localapp
|
||||
methodLevelRequestMappingPath: /hello2
|
||||
myPlaceholderHeader: myPlaceholderHeaderValue
|
||||
endpoints.default.web.enabled: true
|
||||
management.endpoints.web.expose: '*'
|
||||
|
||||
+22
-22
@@ -93,7 +93,7 @@ public class EurekaClientAutoConfigurationTests {
|
||||
|
||||
@Test
|
||||
public void shouldNotSetManagementAndJmxPortsInMetadataMap() throws Exception {
|
||||
addEnvironment(this.context, "server.port=8989", "management.port=0");
|
||||
addEnvironment(this.context, "server.port=8989", "management.server.port=0");
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
|
||||
EurekaInstanceConfigBean instance = this.context
|
||||
@@ -105,7 +105,7 @@ public class EurekaClientAutoConfigurationTests {
|
||||
|
||||
@Test
|
||||
public void shouldSetManagementAndJmxPortsInMetadataMap() throws Exception {
|
||||
addEnvironment(this.context, "management.port=9999",
|
||||
addEnvironment(this.context, "management.server.port=9999",
|
||||
"com.sun.management.jmxremote.port=6789");
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
|
||||
@@ -117,7 +117,7 @@ public class EurekaClientAutoConfigurationTests {
|
||||
|
||||
@Test
|
||||
public void shouldNotResetManagementAndJmxPortsInMetadataMap() throws Exception {
|
||||
addEnvironment(this.context, "management.port=9999",
|
||||
addEnvironment(this.context, "management.server.port=9999",
|
||||
"eureka.instance.metadata-map.jmx.port=9898",
|
||||
"eureka.instance.metadata-map.management.port=7878");
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
@@ -168,7 +168,7 @@ public class EurekaClientAutoConfigurationTests {
|
||||
@Test
|
||||
public void managementPort() {
|
||||
TestPropertyValues.of("server.port=8989",
|
||||
"management.port=9999").applyTo(this.context);
|
||||
"management.server.port=9999").applyTo(this.context);
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
EurekaInstanceConfigBean instance = this.context
|
||||
.getBean(EurekaInstanceConfigBean.class);
|
||||
@@ -179,7 +179,7 @@ public class EurekaClientAutoConfigurationTests {
|
||||
@Test
|
||||
public void statusPageUrlPathAndManagementPort() {
|
||||
TestPropertyValues.of( "server.port=8989",
|
||||
"management.port=9999",
|
||||
"management.server.port=9999",
|
||||
"eureka.instance.statusPageUrlPath=/myStatusPage").applyTo(this.context);
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
EurekaInstanceConfigBean instance = this.context
|
||||
@@ -191,7 +191,7 @@ public class EurekaClientAutoConfigurationTests {
|
||||
@Test
|
||||
public void healthCheckUrlPathAndManagementPort() {
|
||||
TestPropertyValues.of( "server.port=8989",
|
||||
"management.port=9999",
|
||||
"management.server.port=9999",
|
||||
"eureka.instance.healthCheckUrlPath=/myHealthCheck").applyTo(this.context);
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
EurekaInstanceConfigBean instance = this.context
|
||||
@@ -203,7 +203,7 @@ public class EurekaClientAutoConfigurationTests {
|
||||
@Test
|
||||
public void statusPageUrl_and_healthCheckUrl_do_not_contain_server_context_path() throws Exception {
|
||||
addEnvironment(this.context, "server.port=8989",
|
||||
"management.port=9999", "server.contextPath=/service");
|
||||
"management.server.port=9999", "server.contextPath=/service");
|
||||
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
EurekaInstanceConfigBean instance = this.context
|
||||
@@ -217,7 +217,7 @@ public class EurekaClientAutoConfigurationTests {
|
||||
@Test
|
||||
public void statusPageUrl_and_healthCheckUrl_contain_management_context_path() throws Exception {
|
||||
addEnvironment(this.context,
|
||||
"server.port=8989", "management.contextPath=/management");
|
||||
"server.port=8989", "management.server.context-path=/management");
|
||||
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
EurekaInstanceConfigBean instance = this.context
|
||||
@@ -231,8 +231,8 @@ public class EurekaClientAutoConfigurationTests {
|
||||
@Test
|
||||
public void statusPageUrlPathAndManagementPortAndContextPath() {
|
||||
TestPropertyValues.of( "server.port=8989",
|
||||
"management.port=9999", "management.contextPath=/manage",
|
||||
"eureka.instance.statusPageUrlPath=/myStatusPage").applyTo(this.context);
|
||||
"management.server.port=9999", "management.server.context-path=/manage",
|
||||
"eureka.instance.status-page-url-path=/myStatusPage").applyTo(this.context);
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
EurekaInstanceConfigBean instance = this.context
|
||||
.getBean(EurekaInstanceConfigBean.class);
|
||||
@@ -243,8 +243,8 @@ public class EurekaClientAutoConfigurationTests {
|
||||
@Test
|
||||
public void healthCheckUrlPathAndManagementPortAndContextPath() {
|
||||
TestPropertyValues.of( "server.port=8989",
|
||||
"management.port=9999", "management.contextPath=/manage",
|
||||
"eureka.instance.healthCheckUrlPath=/myHealthCheck").applyTo(this.context);
|
||||
"management.server.port=9999", "management.server.context-path=/manage",
|
||||
"eureka.instance.health-check-url-path=/myHealthCheck").applyTo(this.context);
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
EurekaInstanceConfigBean instance = this.context
|
||||
.getBean(EurekaInstanceConfigBean.class);
|
||||
@@ -255,8 +255,8 @@ public class EurekaClientAutoConfigurationTests {
|
||||
@Test
|
||||
public void statusPageUrlPathAndManagementPortAndContextPathKebobCase() {
|
||||
TestPropertyValues.of( "server.port=8989",
|
||||
"management.port=9999", "management.context-path=/manage",
|
||||
"eureka.instance.statusPageUrlPath=/myStatusPage").applyTo(this.context);
|
||||
"management.server.port=9999", "management.server.context-path=/manage",
|
||||
"eureka.instance.status-page-url-path=/myStatusPage").applyTo(this.context);
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
EurekaInstanceConfigBean instance = this.context
|
||||
.getBean(EurekaInstanceConfigBean.class);
|
||||
@@ -267,8 +267,8 @@ public class EurekaClientAutoConfigurationTests {
|
||||
@Test
|
||||
public void healthCheckUrlPathAndManagementPortAndContextPathKebobCase() {
|
||||
TestPropertyValues.of( "server.port=8989",
|
||||
"management.port=9999", "management.context-path=/manage",
|
||||
"eureka.instance.healthCheckUrlPath=/myHealthCheck").applyTo(this.context);
|
||||
"management.server.port=9999", "management.server.context-path=/manage",
|
||||
"eureka.instance.health-check-url-path=/myHealthCheck").applyTo(this.context);
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
EurekaInstanceConfigBean instance = this.context
|
||||
.getBean(EurekaInstanceConfigBean.class);
|
||||
@@ -279,7 +279,7 @@ public class EurekaClientAutoConfigurationTests {
|
||||
@Test
|
||||
public void statusPageUrlPathAndManagementPortKabobCase() {
|
||||
TestPropertyValues.of( "server.port=8989",
|
||||
"management.port=9999",
|
||||
"management.server.port=9999",
|
||||
"eureka.instance.status-page-url-path=/myStatusPage").applyTo(this.context);
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
EurekaInstanceConfigBean instance = this.context
|
||||
@@ -291,7 +291,7 @@ public class EurekaClientAutoConfigurationTests {
|
||||
@Test
|
||||
public void statusPageUrlAndPreferIpAddress() {
|
||||
TestPropertyValues.of( "server.port=8989",
|
||||
"management.port=9999", "eureka.instance.hostname=foo",
|
||||
"management.server.port=9999", "eureka.instance.hostname=foo",
|
||||
"eureka.instance.preferIpAddress:true").applyTo(this.context);
|
||||
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
@@ -305,7 +305,7 @@ public class EurekaClientAutoConfigurationTests {
|
||||
@Test
|
||||
public void healthCheckUrlPathAndManagementPortKabobCase() {
|
||||
TestPropertyValues.of( "server.port=8989",
|
||||
"management.port=9999",
|
||||
"management.server.port=9999",
|
||||
"eureka.instance.health-check-url-path=/myHealthCheck").applyTo(this.context);
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
EurekaInstanceConfigBean instance = this.context
|
||||
@@ -317,7 +317,7 @@ public class EurekaClientAutoConfigurationTests {
|
||||
@Test
|
||||
public void statusPageUrlPathAndManagementPortUpperCase() {
|
||||
TestPropertyValues.of( "server.port=8989",
|
||||
"management.port=9999").applyTo(this.context);
|
||||
"management.server.port=9999").applyTo(this.context);
|
||||
addSystemEnvironment(this.context.getEnvironment(), "EUREKA_INSTANCE_STATUS_PAGE_URL_PATH=/myStatusPage");
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
EurekaInstanceConfigBean instance = this.context
|
||||
@@ -329,7 +329,7 @@ public class EurekaClientAutoConfigurationTests {
|
||||
@Test
|
||||
public void healthCheckUrlPathAndManagementPortUpperCase() {
|
||||
TestPropertyValues.of( "server.port=8989",
|
||||
"management.port=9999").applyTo(this.context);
|
||||
"management.server.port=9999").applyTo(this.context);
|
||||
addSystemEnvironment(this.context.getEnvironment(), "EUREKA_INSTANCE_HEALTH_CHECK_URL_PATH=/myHealthCheck");
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
EurekaInstanceConfigBean instance = this.context
|
||||
@@ -341,7 +341,7 @@ public class EurekaClientAutoConfigurationTests {
|
||||
@Test
|
||||
public void hostname() {
|
||||
TestPropertyValues.of( "server.port=8989",
|
||||
"management.port=9999", "eureka.instance.hostname=foo").applyTo(this.context);
|
||||
"management.server.port=9999", "eureka.instance.hostname=foo").applyTo(this.context);
|
||||
setupContext(RefreshAutoConfiguration.class);
|
||||
EurekaInstanceConfigBean instance = this.context
|
||||
.getBean(EurekaInstanceConfigBean.class);
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ import static org.junit.Assert.assertTrue;
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.RANDOM_PORT,
|
||||
properties = {"spring.application.name=eureka", "server.servlet.context-path=/context",
|
||||
"management.security.enabled=false", "endpoints.default.web.enabled=true" })
|
||||
"management.security.enabled=false", "management.endpoints.web.expose=*" })
|
||||
public class ApplicationContextTests {
|
||||
|
||||
@LocalServerPort
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = Application.class, webEnvironment = RANDOM_PORT, properties = {
|
||||
"spring.application.name=eureka", "server.servlet.path=/servlet",
|
||||
"management.security.enabled=false", "endpoints.default.web.enabled=true" })
|
||||
"management.security.enabled=false", "management.endpoints.web.expose=*" })
|
||||
public class ApplicationServletPathTests {
|
||||
|
||||
@LocalServerPort
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = Application.class, webEnvironment = RANDOM_PORT, properties = {
|
||||
"spring.jmx.enabled=true", "management.security.enabled=false", "endpoints.default.web.enabled=true" })
|
||||
"spring.jmx.enabled=true", "management.security.enabled=false", "management.endpoints.web.expose=*" })
|
||||
public class ApplicationTests {
|
||||
|
||||
@LocalServerPort
|
||||
|
||||
+3
-1
@@ -51,7 +51,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = RANDOM_PORT,
|
||||
value = {"zuul.routes.sslservice.url=https://localhost:8443", "management.security.enabled=false"})
|
||||
value = {"zuul.routes.sslservice.url=https://localhost:8443", "management.security.enabled=false", "management.endpoints.web.expose=*"})
|
||||
@DirtiesContext
|
||||
public class RoutesEndpointIntegrationTests {
|
||||
|
||||
@@ -62,12 +62,14 @@ public class RoutesEndpointIntegrationTests {
|
||||
private SimpleZuulProxyApplication.RoutesRefreshListener refreshListener;
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void getRoutesTest() {
|
||||
Map<String, String> routes = restTemplate.getForObject("/application/routes", Map.class);
|
||||
assertEquals("https://localhost:8443", routes.get("/sslservice/**"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void postRoutesTest() {
|
||||
Map<String, String> routes = restTemplate.postForObject("/application/routes", null, Map.class);
|
||||
assertEquals("https://localhost:8443", routes.get("/sslservice/**"));
|
||||
|
||||
Reference in New Issue
Block a user