diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/BootstrapConfigServerIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/BootstrapConfigServerIntegrationTests.java index 67bc1ee2..be2fba0a 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/BootstrapConfigServerIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/BootstrapConfigServerIntegrationTests.java @@ -67,7 +67,7 @@ public class BootstrapConfigServerIntegrationTests { @Test public void contextLoads() { ResponseEntity response = new TestRestTemplate().exchange( - "http://localhost:" + this.port + "/foo/development/", HttpMethod.GET, getV2AcceptEntity(), + "http://localhost:" + this.port + "/foo/development", HttpMethod.GET, getV2AcceptEntity(), Environment.class); Environment environment = response.getBody(); assertThat(environment.getPropertySources()).hasSize(2); diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/CompositeIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/CompositeIntegrationTests.java index b1410e63..04d09cb2 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/CompositeIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/CompositeIntegrationTests.java @@ -70,7 +70,7 @@ public class CompositeIntegrationTests { @Test public void contextLoads() { ResponseEntity response = new TestRestTemplate().exchange( - "http://localhost:" + this.port + "/foo/development/", HttpMethod.GET, getV2AcceptEntity(), + "http://localhost:" + this.port + "/foo/development", HttpMethod.GET, getV2AcceptEntity(), Environment.class); Environment environment = response.getBody(); assertThat(3).isEqualTo(environment.getPropertySources().size()); @@ -121,7 +121,7 @@ public class CompositeIntegrationTests { @Test public void contextLoads() { ResponseEntity response = new TestRestTemplate().exchange( - "http://localhost:" + this.port + "/foo/development/", HttpMethod.GET, getV2AcceptEntity(), + "http://localhost:" + this.port + "/foo/development", HttpMethod.GET, getV2AcceptEntity(), Environment.class); Environment environment = response.getBody(); assertThat(environment.getPropertySources()).hasSize(3); diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ConfigClientBackwardsCompatibilityIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ConfigClientBackwardsCompatibilityIntegrationTests.java index 7131e79d..3b1a19a8 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ConfigClientBackwardsCompatibilityIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/ConfigClientBackwardsCompatibilityIntegrationTests.java @@ -64,7 +64,7 @@ public class ConfigClientBackwardsCompatibilityIntegrationTests { @Test public void testBackwardsCompatibleFormat() { - Map environment = new TestRestTemplate().getForObject("http://localhost:" + this.port + "/foo/development/", + Map environment = new TestRestTemplate().getForObject("http://localhost:" + this.port + "/foo/development", Map.class); Object value = getPropertySourceValue(environment); assertThat(value).isInstanceOf(String.class).isEqualTo("true"); @@ -81,7 +81,7 @@ public class ConfigClientBackwardsCompatibilityIntegrationTests { @Test public void testNewFormat() { ResponseEntity response = new TestRestTemplate().exchange( - "http://localhost:" + this.port + "/foo/development/", HttpMethod.GET, getV2AcceptEntity(), Map.class); + "http://localhost:" + this.port + "/foo/development", HttpMethod.GET, getV2AcceptEntity(), Map.class); Object value = getPropertySourceValue(response.getBody()); assertThat(value).isInstanceOf(Map.class); Map valueMap = Map.class.cast(value); @@ -99,9 +99,10 @@ public class ConfigClientBackwardsCompatibilityIntegrationTests { assertThat(valueMap).containsEntry("value", "true"); } + @SuppressWarnings({ "rawtypes", "unchecked" }) private Object getPropertySourceValue(Map environment) { assertThat(environment).isNotNull(); - assertThat(environment.containsKey("propertySources")); + assertThat(environment.containsKey("propertySources")).isTrue(); List propertySources = (List) environment.get("propertySources"); assertThat(propertySources).hasSizeGreaterThan(1); Map source = (Map) propertySources.get(0); diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/NativeConfigServerIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/NativeConfigServerIntegrationTests.java index f0be98a1..5c45cb7f 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/NativeConfigServerIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/NativeConfigServerIntegrationTests.java @@ -60,7 +60,7 @@ public class NativeConfigServerIntegrationTests { @Test public void contextLoads() { ResponseEntity response = new TestRestTemplate().exchange( - "http://localhost:" + this.port + "/foo/development/", HttpMethod.GET, getV2AcceptEntity(), + "http://localhost:" + this.port + "/foo/development", HttpMethod.GET, getV2AcceptEntity(), Environment.class); Environment environment = response.getBody(); assertThat(environment.getPropertySources().isEmpty()).isFalse(); @@ -83,7 +83,7 @@ public class NativeConfigServerIntegrationTests { @Test public void badYaml() { ResponseEntity response = new TestRestTemplate() - .getForEntity("http://localhost:" + this.port + "/bad/default/", String.class); + .getForEntity("http://localhost:" + this.port + "/bad/default", String.class); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR); } diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/RefreshableConfigServerIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/RefreshableConfigServerIntegrationTests.java index 26c8625a..7b1f8586 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/RefreshableConfigServerIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/RefreshableConfigServerIntegrationTests.java @@ -94,7 +94,7 @@ public class RefreshableConfigServerIntegrationTests { @Test public void refreshOverrides() { ResponseEntity entity = new TestRestTemplate().exchange( - "http://localhost:" + this.port + "/foo/development/", HttpMethod.GET, getV2AcceptEntity(), + "http://localhost:" + this.port + "/foo/development", HttpMethod.GET, getV2AcceptEntity(), Environment.class); Environment environment = entity.getBody(); assertThat(environment.getPropertySources()).isEmpty(); @@ -111,7 +111,7 @@ public class RefreshableConfigServerIntegrationTests { response = new TestRestTemplate().postForEntity(actuatorEndpoint + "/refresh", null, Void.class); assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK); - entity = new TestRestTemplate().exchange("http://localhost:" + this.port + "/foo/development/", HttpMethod.GET, + entity = new TestRestTemplate().exchange("http://localhost:" + this.port + "/foo/development", HttpMethod.GET, getV2AcceptEntity(), Environment.class); environment = entity.getBody(); assertThat(environment.getPropertySources()).isNotEmpty(); diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/SubversionConfigServerIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/SubversionConfigServerIntegrationTests.java index 25bcb4c3..b07b29f0 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/SubversionConfigServerIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/SubversionConfigServerIntegrationTests.java @@ -70,7 +70,7 @@ public class SubversionConfigServerIntegrationTests { @Test public void contextLoads() { ResponseEntity exchange = new TestRestTemplate().exchange( - "http://localhost:" + this.port + "/foo/development/", HttpMethod.GET, getV2AcceptEntity(), + "http://localhost:" + this.port + "/foo/development", HttpMethod.GET, getV2AcceptEntity(), Environment.class); Environment environment = exchange.getBody(); assertThat(environment.getPropertySources().isEmpty()).isFalse(); diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/VanillaConfigServerIntegrationTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/VanillaConfigServerIntegrationTests.java index 7040bb3c..e0614b54 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/VanillaConfigServerIntegrationTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/VanillaConfigServerIntegrationTests.java @@ -65,7 +65,7 @@ public class VanillaConfigServerIntegrationTests { @Test public void contextLoads() { ResponseEntity response = new TestRestTemplate().exchange( - "http://localhost:" + this.port + "/foo/development/", HttpMethod.GET, getV2AcceptEntity(), + "http://localhost:" + this.port + "/foo/development", HttpMethod.GET, getV2AcceptEntity(), Environment.class); Environment environment = response.getBody(); assertThat(environment.getPropertySources().isEmpty()).isFalse(); diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/config/CustomCompositeEnvironmentRepositoryTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/config/CustomCompositeEnvironmentRepositoryTests.java index e5c754ae..47f8a2fc 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/config/CustomCompositeEnvironmentRepositoryTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/config/CustomCompositeEnvironmentRepositoryTests.java @@ -76,7 +76,7 @@ public class CustomCompositeEnvironmentRepositoryTests { @Test public void contextLoads() { Environment environment = new TestRestTemplate() - .getForObject("http://localhost:" + this.port + "/foo/development/", Environment.class); + .getForObject("http://localhost:" + this.port + "/foo/development", Environment.class); List propertySources = environment.getPropertySources(); assertThat(3).isEqualTo(propertySources.size()); assertThat("overrides").isEqualTo(propertySources.get(0).getName()); @@ -128,7 +128,7 @@ public class CustomCompositeEnvironmentRepositoryTests { @Test public void contextLoads() { Environment environment = new TestRestTemplate() - .getForObject("http://localhost:" + this.port + "/foo/development/", Environment.class); + .getForObject("http://localhost:" + this.port + "/foo/development", Environment.class); List propertySources = environment.getPropertySources(); assertThat(3).isEqualTo(propertySources.size()); assertThat("overrides").isEqualTo(propertySources.get(0).getName()); diff --git a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/config/CustomEnvironmentRepositoryTests.java b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/config/CustomEnvironmentRepositoryTests.java index 0149d22f..a61956e6 100644 --- a/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/config/CustomEnvironmentRepositoryTests.java +++ b/spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/config/CustomEnvironmentRepositoryTests.java @@ -54,7 +54,7 @@ public class CustomEnvironmentRepositoryTests { @Test public void contextLoads() { Environment environment = new TestRestTemplate() - .getForObject("http://localhost:" + this.port + "/foo/development/", Environment.class); + .getForObject("http://localhost:" + this.port + "/foo/development", Environment.class); assertThat(environment.getPropertySources().isEmpty()).isFalse(); }