Updates test calls to remove trailing slash
This commit is contained in:
@@ -67,7 +67,7 @@ public class BootstrapConfigServerIntegrationTests {
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
ResponseEntity<Environment> 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);
|
||||
|
||||
@@ -70,7 +70,7 @@ public class CompositeIntegrationTests {
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
ResponseEntity<Environment> 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<Environment> 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);
|
||||
|
||||
@@ -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<Map> 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);
|
||||
|
||||
@@ -60,7 +60,7 @@ public class NativeConfigServerIntegrationTests {
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
ResponseEntity<Environment> 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<String> 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public class RefreshableConfigServerIntegrationTests {
|
||||
@Test
|
||||
public void refreshOverrides() {
|
||||
ResponseEntity<Environment> 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();
|
||||
|
||||
@@ -70,7 +70,7 @@ public class SubversionConfigServerIntegrationTests {
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
ResponseEntity<Environment> 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();
|
||||
|
||||
@@ -65,7 +65,7 @@ public class VanillaConfigServerIntegrationTests {
|
||||
@Test
|
||||
public void contextLoads() {
|
||||
ResponseEntity<Environment> 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();
|
||||
|
||||
@@ -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<PropertySource> 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<PropertySource> propertySources = environment.getPropertySources();
|
||||
assertThat(3).isEqualTo(propertySources.size());
|
||||
assertThat("overrides").isEqualTo(propertySources.get(0).getName());
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user