File tree Expand file tree Collapse file tree 5 files changed +23
-156
lines changed
main/java/org/springframework/boot/health
test/java/org/springframework/boot/health
spring-boot-jms/src/test/java/org/springframework/boot/jms/actuate/health Expand file tree Collapse file tree 5 files changed +23
-156
lines changed Original file line number Diff line number Diff line change @@ -16,4 +16,6 @@ dependencies {
16
16
testImplementation(project(" :spring-boot-project:spring-boot-tools:spring-boot-test-support" ))
17
17
testImplementation(" com.fasterxml.jackson.core:jackson-databind" )
18
18
testImplementation(" io.projectreactor:reactor-test" )
19
+
20
+ testRuntimeOnly(" ch.qos.logback:logback-classic" )
19
21
}
Original file line number Diff line number Diff line change @@ -35,10 +35,7 @@ static ReactiveHealthContributor adapt(HealthContributor healthContributor) {
35
35
if (healthContributor instanceof HealthIndicator healthIndicator ) {
36
36
return new HealthIndicatorReactiveAdapter (healthIndicator );
37
37
}
38
- if (healthContributor instanceof CompositeHealthContributor compositeHealthContributor ) {
39
- return new CompositeHealthContributorReactiveAdapter (compositeHealthContributor );
40
- }
41
- throw new IllegalStateException ("Unknown HealthContributor type" );
38
+ return new CompositeHealthContributorReactiveAdapter ((CompositeHealthContributor ) healthContributor );
42
39
}
43
40
44
41
}
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2012-2025 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ /**
18
+ * Classes related to monitoring the health of an application.
19
+ */
20
+ package org .springframework .boot .health ;
Original file line number Diff line number Diff line change 22
22
23
23
import static org .assertj .core .api .Assertions .assertThat ;
24
24
import static org .assertj .core .api .Assertions .assertThatIllegalArgumentException ;
25
- import static org .assertj .core .api .Assertions .assertThatIllegalStateException ;
26
- import static org .mockito .Mockito .mock ;
27
25
28
26
/**
29
27
* Tests for {@link ReactiveHealthContributor}.
@@ -57,11 +55,4 @@ void adaptWhenCompositeHealthContributorReturnsCompositeHealthContributorReactiv
57
55
assertThat (((ReactiveHealthIndicator ) contained ).health ().block ().getStatus ()).isEqualTo (Status .OUT_OF_SERVICE );
58
56
}
59
57
60
- @ Test
61
- void adaptWhenUnknownThrowsException () {
62
- assertThatIllegalStateException ()
63
- .isThrownBy (() -> ReactiveHealthContributor .adapt (mock (HealthContributor .class )))
64
- .withMessage ("Unknown HealthContributor type" );
65
- }
66
-
67
58
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments