Skip to content

Commit a106541

Browse files
committed
feat: fix failing tests
1 parent 51290c6 commit a106541

File tree

6 files changed

+31
-5
lines changed

6 files changed

+31
-5
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
server:
2+
shutdown: immediate

spring-boot-admin-samples/spring-boot-admin-sample-servlet/src/main/resources/application.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,34 @@ management:
3434
enabled: true
3535
health:
3636
show-details: ALWAYS
37+
server:
38+
port: 9999
39+
3740

3841
spring:
3942
application:
4043
name: spring-boot-admin-sample-servlet
44+
cloud:
45+
discovery:
46+
client:
47+
simple:
48+
instances:
49+
SBA:
50+
- uri: http://localhost:9999
51+
metadata:
52+
management.context-path: /actuator
53+
service-url: http://localhost:8080
54+
service-path: /
4155
boot:
4256
admin:
4357
client:
4458
url: http://localhost:8080
4559
instance:
4660
service-host-type: IP
4761
metadata:
62+
service-path: /foo
63+
service-url: http://localhost:8080
64+
hide-url: true
4865
tags:
4966
environment: test
5067
de-service-test-1: A large content
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
server:
2+
shutdown: immediate
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
server:
2+
shutdown: immediate

spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/domain/values/Registration.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public final class Registration implements Serializable {
5454
/**
5555
* Absolute URL of the Actuator health endpoint. Required and used by Spring Boot
5656
* Admin to determine the instance status. Example:
57-
* <code>https://example.com/actuator</code>
57+
* <code>https://example.com/actuator/health</code>
5858
*/
5959
private final String healthUrl;
6060

@@ -81,8 +81,6 @@ private Registration(String name, @Nullable String managementUrl, String healthU
8181
Assert.isTrue(!StringUtils.hasText(serviceUrl) || checkUrl(serviceUrl),
8282
"'serviceUrl' is not valid: " + serviceUrl);
8383

84-
assert serviceUrl != null;
85-
8684
this.name = name;
8785
this.managementUrl = managementUrl;
8886
this.healthUrl = healthUrl;
@@ -111,7 +109,11 @@ public static Registration.Builder copyOf(Registration registration) {
111109
* @param metadata metadata information of registered instance
112110
* @return the actual service url
113111
*/
114-
private String getServiceUrl(String serviceUrl, Map<String, String> metadata) {
112+
@Nullable
113+
private String getServiceUrl(@Nullable String serviceUrl, Map<String, String> metadata) {
114+
if (serviceUrl == null) {
115+
return null;
116+
}
115117
String url = metadata.getOrDefault("service-url", serviceUrl);
116118

117119
try {

spring-boot-admin-server/src/test/resources/application.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
server:
2-
port: 8080
2+
port: 8080
3+
shutdown: immediate
34
spring:
45
application:
56
name: spring-boot-admin-server-test

0 commit comments

Comments
 (0)