Skip to content

Commit d7712b2

Browse files
Tommy Ludwigjoshiste
authored andcommitted
Fixes Cloud Foundry registration with uppercase letters in route
Before this, the route was always lower-cased, but this makes the route registered with Spring Boot Admin not accessible. This changes to use the route as it is, and updates a test to include an uppercase letter in the route.
1 parent 6a8975b commit d7712b2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/CloudFoundryApplicationFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected String getServiceBaseUrl() {
4545
return null;
4646
}
4747

48-
String uri = cfApplicationProperties.getUris().get(0).toLowerCase();
48+
String uri = cfApplicationProperties.getUris().get(0);
4949
return "http://" + uri;
5050
}
5151
}

spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/CloudFoundryApplicationFactoryTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ public void setup() {
5050
@Test
5151
public void should_use_application_uri() {
5252
when(pathMappedEndpoints.getPath("health")).thenReturn("/actuator/health");
53-
cfApplicationProperties.setUris(singletonList("application"));
53+
cfApplicationProperties.setUris(singletonList("application/Uppercase"));
5454

5555
Application app = factory.createApplication();
5656

57-
assertThat(app.getManagementUrl()).isEqualTo("http://application/actuator");
58-
assertThat(app.getHealthUrl()).isEqualTo("http://application/actuator/health");
59-
assertThat(app.getServiceUrl()).isEqualTo("http://application/");
57+
assertThat(app.getManagementUrl()).isEqualTo("http://application/Uppercase/actuator");
58+
assertThat(app.getHealthUrl()).isEqualTo("http://application/Uppercase/actuator/health");
59+
assertThat(app.getServiceUrl()).isEqualTo("http://application/Uppercase/");
6060
}
6161

6262
}

0 commit comments

Comments
 (0)