Skip to content

Commit 5a99a82

Browse files
RikEndeRik Ende
authored and
Rik Ende
committed
Add a concurrent extension of CompositeHealthIndicator
Unit test to verify output is identical to CompositeHealthIndicator test must work
1 parent 39df941 commit 5a99a82

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/ConcurrentCompositeHealthIndicatorTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.util.concurrent.Callable;
2424
import java.util.concurrent.Executors;
2525
import java.util.concurrent.ThreadPoolExecutor;
26+
import java.util.concurrent.TimeoutException;
2627

2728
import com.fasterxml.jackson.databind.ObjectMapper;
2829
import org.junit.Before;
@@ -122,8 +123,9 @@ public void testWithTimeout() throws Exception {
122123
Health result = composite.health();
123124
assertThat(result.getDetails()).hasSize(1);
124125
assertThat(result.getDetails()).containsEntry("db",
125-
new Health.Builder().down().withException(
126-
new IllegalStateException("Health check timed out after PT0S"))
126+
Health.down()
127+
.withDetail("error", TimeoutException.class.getName()
128+
+ ": health check timed out after " + Duration.ZERO)
127129
.build());
128130

129131
}

0 commit comments

Comments
 (0)