From 73f334563825467b33af4b9f9dc91aa7bbb78c3c Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Thu, 25 May 2017 12:37:34 -0600 Subject: [PATCH] Fix tests --- pom.xml | 2 +- spring-cloud-netflix-core/pom.xml | 5 ++++ .../metrics/atlas/AtlasExporterTests.java | 2 +- .../ServletPathZuulProxyApplicationTests.java | 2 +- ...tpClientRibbonCommandIntegrationTests.java | 3 +- ...HttpClientRibbonRetryIntegrationTests.java | 9 ++++-- .../OkHttpRibbonRetryIntegrationTests.java | 9 ++++-- spring-cloud-netflix-dependencies/pom.xml | 5 ++++ .../server/ApplicationContextTests.java | 20 ++++++------- .../server/ApplicationServletPathTests.java | 22 +++++++-------- .../eureka/server/ApplicationTests.java | 28 +++++++++---------- .../pom.xml | 5 ++++ .../HystrixDashboardContextTests.java | 21 +++++++------- spring-cloud-netflix-hystrix-stream/pom.xml | 5 ++++ .../hystrix/stream/HystrixStreamTests.java | 4 +-- spring-cloud-netflix-sidecar/pom.xml | 5 ++++ .../sidecar/SidecarApplicationTests.java | 22 +++++++-------- spring-cloud-netflix-turbine/pom.xml | 5 ++++ spring-cloud-starter-archaius/pom.xml | 6 ---- 19 files changed, 106 insertions(+), 74 deletions(-) diff --git a/pom.xml b/pom.xml index d300f222..9192e092 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ 2.7.3 2.0.0.BUILD-SNAPSHOT 2.0.0.BUILD-SNAPSHOT - Chelsea.BUILD-SNAPSHOT + Elmhurst.BUILD-SNAPSHOT 2.19.1 diff --git a/spring-cloud-netflix-core/pom.xml b/spring-cloud-netflix-core/pom.xml index 99611e85..d4e3ae1c 100644 --- a/spring-cloud-netflix-core/pom.xml +++ b/spring-cloud-netflix-core/pom.xml @@ -75,6 +75,11 @@ commons-configuration true + + commons-logging + commons-logging + true + com.netflix.servo diff --git a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/metrics/atlas/AtlasExporterTests.java b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/metrics/atlas/AtlasExporterTests.java index 644ebcb1..f351f42a 100644 --- a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/metrics/atlas/AtlasExporterTests.java +++ b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/metrics/atlas/AtlasExporterTests.java @@ -51,7 +51,7 @@ public class AtlasExporterTests { MockRestServiceServer mockServer = MockRestServiceServer .createServer(this.restTemplate); - mockServer.expect(MockRestRequestMatchers.requestTo("atlas/api/v1/publish")) + mockServer.expect(MockRestRequestMatchers.requestTo("/atlas/api/v1/publish")) .andExpect(MockRestRequestMatchers.method(HttpMethod.POST)) .andRespond(MockRestResponseCreators.withSuccess("{\"status\" : \"OK\"}", MediaType.APPLICATION_JSON)); diff --git a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/ServletPathZuulProxyApplicationTests.java b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/ServletPathZuulProxyApplicationTests.java index 1f827b2d..cd11cc30 100644 --- a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/ServletPathZuulProxyApplicationTests.java +++ b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/ServletPathZuulProxyApplicationTests.java @@ -53,7 +53,7 @@ import com.netflix.zuul.context.RequestContext; @SpringBootTest( classes = ServletPathZuulProxyApplicationTests.ServletPathZuulProxyApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT, - value = {"server.servletPath: /app"}) + properties = {"server.servlet.path: /app"}) @DirtiesContext public class ServletPathZuulProxyApplicationTests { diff --git a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/apache/HttpClientRibbonCommandIntegrationTests.java b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/apache/HttpClientRibbonCommandIntegrationTests.java index 3674a94a..a2da21ce 100644 --- a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/apache/HttpClientRibbonCommandIntegrationTests.java +++ b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/apache/HttpClientRibbonCommandIntegrationTests.java @@ -78,7 +78,8 @@ import com.netflix.loadbalancer.ServerList; @SpringBootTest(classes = HttpClientRibbonCommandIntegrationTests.TestConfig.class, webEnvironment = WebEnvironment.RANDOM_PORT, value = { "zuul.routes.other: /test/**=http://localhost:7777/local", "zuul.routes.another: /another/twolevel/**", "zuul.routes.simple: /simple/**", - "zuul.routes.singleton: /singleton/**", + "zuul.routes.singleton.id: singleton", + "zuul.routes.singleton.path: /singleton/**", "zuul.routes.singleton.sensitiveHeaders: " }) @DirtiesContext public class HttpClientRibbonCommandIntegrationTests extends ZuulProxyTestBase { diff --git a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/apache/HttpClientRibbonRetryIntegrationTests.java b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/apache/HttpClientRibbonRetryIntegrationTests.java index ee46f2f4..d7d737b3 100644 --- a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/apache/HttpClientRibbonRetryIntegrationTests.java +++ b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/apache/HttpClientRibbonRetryIntegrationTests.java @@ -35,16 +35,19 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen "zuul.retryable: false", /* Disable retry by default, have each route enable it */ "hystrix.command.default.execution.timeout.enabled: false", /* Disable hystrix so its timeout doesnt get in the way */ "ribbon.ReadTimeout: 1000", /* Make sure ribbon will timeout before the thread is done sleeping */ - "zuul.routes.retryable: /retryable/**", + "zuul.routes.retryable.id: retryable", + "zuul.routes.retryable.path: /retryable/**", "zuul.routes.retryable.retryable: true", "retryable.ribbon.OkToRetryOnAllOperations: true", "retryable.ribbon.MaxAutoRetries: 1", "retryable.ribbon.MaxAutoRetriesNextServer: 1", - "zuul.routes.getretryable: /getretryable/**", + "zuul.routes.getretryable.id: getretryable", + "zuul.routes.getretryable.path: /getretryable/**", "zuul.routes.getretryable.retryable: true", "getretryable.ribbon.MaxAutoRetries: 1", "getretryable.ribbon.MaxAutoRetriesNextServer: 1", - "zuul.routes.disableretry: /disableretry/**", + "zuul.routes.disableretry.id: disableretry", + "zuul.routes.disableretry.path: /disableretry/**", "zuul.routes.disableretry.retryable: false", /* This will override the global */ "disableretry.ribbon.MaxAutoRetries: 1", "disableretry.ribbon.MaxAutoRetriesNextServer: 1", diff --git a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/okhttp/OkHttpRibbonRetryIntegrationTests.java b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/okhttp/OkHttpRibbonRetryIntegrationTests.java index e8c39e3d..f56830f4 100644 --- a/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/okhttp/OkHttpRibbonRetryIntegrationTests.java +++ b/spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/okhttp/OkHttpRibbonRetryIntegrationTests.java @@ -33,17 +33,20 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; "ribbon.okhttp.enabled: true", "hystrix.command.default.execution.timeout.enabled: false", /* Disable hystrix so its timeout doesnt get in the way */ "ribbon.ReadTimeout: 1000", /* Make sure ribbon will timeout before the thread is done sleeping */ - "zuul.routes.retryable: /retryable/**", + "zuul.routes.retryable.id: retryable", + "zuul.routes.retryable.path: /retryable/**", "zuul.routes.retryable.retryable: true", "retryable.ribbon.OkToRetryOnAllOperations: true", "retryable.ribbon.retryableStatusCodes: 404", "retryable.ribbon.MaxAutoRetries: 1", "retryable.ribbon.MaxAutoRetriesNextServer: 1", - "zuul.routes.getretryable: /getretryable/**", + "zuul.routes.getretryable.id: getretryable", + "zuul.routes.getretryable.path: /getretryable/**", "zuul.routes.getretryable.retryable: true", "getretryable.ribbon.MaxAutoRetries: 1", "getretryable.ribbon.MaxAutoRetriesNextServer: 1", - "zuul.routes.disableretry: /disableretry/**", + "zuul.routes.disableretry.path: /disableretry/**", + "zuul.routes.disableretry.path: /disableretry/**", "zuul.routes.disableretry.retryable: false", /* This will override the global */ "disableretry.ribbon.MaxAutoRetries: 1", "disableretry.ribbon.MaxAutoRetriesNextServer: 1", diff --git a/spring-cloud-netflix-dependencies/pom.xml b/spring-cloud-netflix-dependencies/pom.xml index 5c1eb9b8..a2ea0b41 100644 --- a/spring-cloud-netflix-dependencies/pom.xml +++ b/spring-cloud-netflix-dependencies/pom.xml @@ -173,6 +173,11 @@ commons-configuration 1.8 + + commons-logging + commons-logging + 1.1.1 + com.sun.jersey diff --git a/spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationContextTests.java b/spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationContextTests.java index 2f356c1d..a79c590b 100644 --- a/spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationContextTests.java +++ b/spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationContextTests.java @@ -17,20 +17,17 @@ package org.springframework.cloud.netflix.eureka.server; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - import java.util.Collections; import java.util.Map; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.cloud.netflix.eureka.server.ApplicationContextTests.Application; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpEntity; @@ -39,15 +36,18 @@ import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit4.SpringRunner; -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.RANDOM_PORT, value = { - "spring.application.name=eureka", "server.servlet.contextPath=/context", +import static org.junit.Assert.assertEquals; +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" }) public class ApplicationContextTests { - @Value("${local.server.port}") + @LocalServerPort private int port = 0; @Test @@ -95,7 +95,7 @@ public class ApplicationContextTests { @SuppressWarnings("rawtypes") ResponseEntity entity = new TestRestTemplate().exchange( - "http://localhost:" + this.port + "/context/env", HttpMethod.GET, + "http://localhost:" + this.port + "/context/application/env", HttpMethod.GET, new HttpEntity<>("parameters", headers), Map.class); assertEquals(HttpStatus.OK, entity.getStatusCode()); } diff --git a/spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationServletPathTests.java b/spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationServletPathTests.java index 33a8d030..aa407cd3 100644 --- a/spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationServletPathTests.java +++ b/spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationServletPathTests.java @@ -16,9 +16,6 @@ package org.springframework.cloud.netflix.eureka.server; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - import java.util.Collections; import java.util.Map; @@ -26,10 +23,9 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.server.LocalServerPort; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.cloud.netflix.eureka.server.ApplicationServletPathTests.Application; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpEntity; @@ -38,11 +34,15 @@ import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit4.SpringRunner; -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.RANDOM_PORT, value = { - "spring.application.name=eureka", "server.servletPath=/servlet", +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = Application.class, webEnvironment = RANDOM_PORT, properties = { + "spring.application.name=eureka", "server.servlet.path=/servlet", "management.security.enabled=false" }) public class ApplicationServletPathTests { @@ -56,7 +56,7 @@ public class ApplicationServletPathTests { public static void main(String[] args) { new SpringApplicationBuilder(Application.class) .properties("spring.application.name=eureka", - "server.servletPath=/servlet") + "server.servlet.path=/servlet") .run(args); } } @@ -106,7 +106,7 @@ public class ApplicationServletPathTests { @SuppressWarnings("rawtypes") ResponseEntity entity = new TestRestTemplate().exchange( - "http://localhost:" + this.port + "/servlet/env", HttpMethod.GET, + "http://localhost:" + this.port + "/servlet/application/env", HttpMethod.GET, new HttpEntity<>("parameters", headers), Map.class); assertEquals(HttpStatus.OK, entity.getStatusCode()); } diff --git a/spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationTests.java b/spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationTests.java index 0afdcd88..f1c7a674 100644 --- a/spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationTests.java +++ b/spring-cloud-netflix-eureka-server/src/test/java/org/springframework/cloud/netflix/eureka/server/ApplicationTests.java @@ -16,14 +16,6 @@ package org.springframework.cloud.netflix.eureka.server; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; - import java.util.Collections; import java.util.Map; @@ -32,10 +24,9 @@ import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.server.LocalServerPort; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.cloud.netflix.eureka.server.ApplicationTests.Application; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpEntity; @@ -44,14 +35,23 @@ import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit4.SpringRunner; import com.netflix.appinfo.InstanceInfo; import com.netflix.discovery.converters.wrappers.CodecWrapper; import com.netflix.eureka.resources.ServerCodecs; -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.RANDOM_PORT, value = { +import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = Application.class, webEnvironment = RANDOM_PORT, properties = { "spring.jmx.enabled=true", "management.security.enabled=false" }) public class ApplicationTests { @@ -76,7 +76,7 @@ public class ApplicationTests { @SuppressWarnings("rawtypes") ResponseEntity entity = new TestRestTemplate().exchange( - "http://localhost:" + this.port + "/env", HttpMethod.GET, + "http://localhost:" + this.port + "/application/env", HttpMethod.GET, new HttpEntity<>("parameters", headers), Map.class); assertEquals(HttpStatus.OK, entity.getStatusCode()); } diff --git a/spring-cloud-netflix-hystrix-dashboard/pom.xml b/spring-cloud-netflix-hystrix-dashboard/pom.xml index d99a9591..b624e239 100644 --- a/spring-cloud-netflix-hystrix-dashboard/pom.xml +++ b/spring-cloud-netflix-hystrix-dashboard/pom.xml @@ -63,6 +63,11 @@ compile true + + commons-logging + commons-logging + test + org.springframework.boot spring-boot-starter-test diff --git a/spring-cloud-netflix-hystrix-dashboard/src/test/java/org/springframework/cloud/netflix/hystrix/dashboard/HystrixDashboardContextTests.java b/spring-cloud-netflix-hystrix-dashboard/src/test/java/org/springframework/cloud/netflix/hystrix/dashboard/HystrixDashboardContextTests.java index bf286f91..19f10297 100644 --- a/spring-cloud-netflix-hystrix-dashboard/src/test/java/org/springframework/cloud/netflix/hystrix/dashboard/HystrixDashboardContextTests.java +++ b/spring-cloud-netflix-hystrix-dashboard/src/test/java/org/springframework/cloud/netflix/hystrix/dashboard/HystrixDashboardContextTests.java @@ -17,34 +17,35 @@ package org.springframework.cloud.netflix.hystrix.dashboard; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.cloud.netflix.hystrix.dashboard.HystrixDashboardContextTests.Application; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit4.SpringRunner; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; /** * @author Dave Syer * */ -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.RANDOM_PORT, value = { "spring.application.name=hystrix-dashboard", - "server.servlet.contextPath=/context" }) +@RunWith(SpringRunner.class) +@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.RANDOM_PORT, + properties = { "spring.application.name=hystrix-dashboard", + "server.servlet.context-path=/context" }) public class HystrixDashboardContextTests { public static final String JQUERY_PATH = "/context/webjars/jquery/2.1.1/jquery.min.js"; - @Value("${local.server.port}") + @LocalServerPort private int port = 0; @Test @@ -100,7 +101,7 @@ public class HystrixDashboardContextTests { public static void main(String[] args) { new SpringApplicationBuilder(Application.class).properties( "spring.application.name=hystrix-dashboard", - "server.servlet.contextPath=/context").run(); + "server.servlet.context-path=/context").run(); } } diff --git a/spring-cloud-netflix-hystrix-stream/pom.xml b/spring-cloud-netflix-hystrix-stream/pom.xml index e123fbe7..9857a93e 100644 --- a/spring-cloud-netflix-hystrix-stream/pom.xml +++ b/spring-cloud-netflix-hystrix-stream/pom.xml @@ -45,6 +45,11 @@ com.netflix.hystrix hystrix-core + + commons-logging + commons-logging + test + com.netflix.hystrix hystrix-metrics-event-stream diff --git a/spring-cloud-netflix-hystrix-stream/src/test/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamTests.java b/spring-cloud-netflix-hystrix-stream/src/test/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamTests.java index f6a278f7..f71b7cff 100644 --- a/spring-cloud-netflix-hystrix-stream/src/test/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamTests.java +++ b/spring-cloud-netflix-hystrix-stream/src/test/java/org/springframework/cloud/netflix/hystrix/stream/HystrixStreamTests.java @@ -35,8 +35,8 @@ import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; * @author Spencer Gibb */ @RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = HystrixStreamTests.Application.class, webEnvironment = WebEnvironment.RANDOM_PORT, value = { - "server.port=0", "spring.jmx.enabled=true" }) +@SpringBootTest(classes = HystrixStreamTests.Application.class, webEnvironment = WebEnvironment.RANDOM_PORT, + properties = { "spring.jmx.enabled=true" }) @DirtiesContext public class HystrixStreamTests { diff --git a/spring-cloud-netflix-sidecar/pom.xml b/spring-cloud-netflix-sidecar/pom.xml index 449160fb..20e9e92d 100644 --- a/spring-cloud-netflix-sidecar/pom.xml +++ b/spring-cloud-netflix-sidecar/pom.xml @@ -96,6 +96,11 @@ compile true + + commons-logging + commons-logging + test + org.springframework.boot spring-boot-starter-test diff --git a/spring-cloud-netflix-sidecar/src/test/java/org/springframework/cloud/netflix/sidecar/SidecarApplicationTests.java b/spring-cloud-netflix-sidecar/src/test/java/org/springframework/cloud/netflix/sidecar/SidecarApplicationTests.java index 2a64dea7..6e24dbb6 100644 --- a/spring-cloud-netflix-sidecar/src/test/java/org/springframework/cloud/netflix/sidecar/SidecarApplicationTests.java +++ b/spring-cloud-netflix-sidecar/src/test/java/org/springframework/cloud/netflix/sidecar/SidecarApplicationTests.java @@ -20,19 +20,19 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit4.SpringRunner; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; +import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; public class SidecarApplicationTests { - @RunWith(SpringJUnit4ClassRunner.class) - @SpringBootTest(classes = SidecarApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT, value = { + @RunWith(SpringRunner.class) + @SpringBootTest(classes = SidecarApplication.class, webEnvironment = RANDOM_PORT, properties = { "spring.application.name=mytest", "spring.cloud.client.hostname=mhhost", "spring.application.instance_id=1", - "eureka.instance.hostname=mhhost", "sidecar.port=7000", "sidecar.ipAddress=127.0.0.1" }) + "eureka.instance.hostname=mhhost", "sidecar.port=7000", "sidecar.ip-address=127.0.0.1" }) public static class EurekaTestConfigBeanTest { @Autowired EurekaInstanceConfigBean config; @@ -46,10 +46,10 @@ public class SidecarApplicationTests { } } - @RunWith(SpringJUnit4ClassRunner.class) - @SpringBootTest(classes = SidecarApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT, value = { + @RunWith(SpringRunner.class) + @SpringBootTest(classes = SidecarApplication.class, webEnvironment = RANDOM_PORT, properties = { "spring.application.name=mytest", "spring.cloud.client.hostname=mhhost", "spring.application.instance_id=1", - "sidecar.hostname=mhhost", "sidecar.port=7000", "sidecar.ipAddress=127.0.0.1" }) + "sidecar.hostname=mhhost", "sidecar.port=7000", "sidecar.ip-address=127.0.0.1" }) public static class NewPropertyEurekaTestConfigBeanTest { @Autowired EurekaInstanceConfigBean config; @@ -63,10 +63,10 @@ public class SidecarApplicationTests { } } - @RunWith(SpringJUnit4ClassRunner.class) - @SpringBootTest(classes = SidecarApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT, value = { + @RunWith(SpringRunner.class) + @SpringBootTest(classes = SidecarApplication.class, webEnvironment = RANDOM_PORT, properties = { "spring.application.name=mytest", "spring.cloud.client.hostname=mhhost", "spring.application.instance_id=1", - "eureka.instance.hostname=mhhost1", "sidecar.hostname=mhhost2", "sidecar.port=7000", "sidecar.ipAddress=127.0.0.1" }) + "eureka.instance.hostname=mhhost1", "sidecar.hostname=mhhost2", "sidecar.port=7000", "sidecar.ip-address=127.0.0.1" }) public static class BothPropertiesEurekaTestConfigBeanTest { @Autowired EurekaInstanceConfigBean config; diff --git a/spring-cloud-netflix-turbine/pom.xml b/spring-cloud-netflix-turbine/pom.xml index 0ba00f39..24c67363 100644 --- a/spring-cloud-netflix-turbine/pom.xml +++ b/spring-cloud-netflix-turbine/pom.xml @@ -96,6 +96,11 @@ compile true + + commons-logging + commons-logging + test + org.springframework.boot spring-boot-starter-test diff --git a/spring-cloud-starter-archaius/pom.xml b/spring-cloud-starter-archaius/pom.xml index 048a918c..7bcef00f 100644 --- a/spring-cloud-starter-archaius/pom.xml +++ b/spring-cloud-starter-archaius/pom.xml @@ -36,12 +36,6 @@ commons-configuration commons-configuration - - - commons-logging - commons-logging - - com.fasterxml.jackson.core