Skip to content

Commit 8811b2f

Browse files
committed
fixup! Create spring-boot-health module
1 parent edafe4c commit 8811b2f

File tree

5 files changed

+23
-156
lines changed

5 files changed

+23
-156
lines changed

spring-boot-project/spring-boot-health/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ dependencies {
1616
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
1717
testImplementation("com.fasterxml.jackson.core:jackson-databind")
1818
testImplementation("io.projectreactor:reactor-test")
19+
20+
testRuntimeOnly("ch.qos.logback:logback-classic")
1921
}

spring-boot-project/spring-boot-health/src/main/java/org/springframework/boot/health/ReactiveHealthContributor.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ static ReactiveHealthContributor adapt(HealthContributor healthContributor) {
3535
if (healthContributor instanceof HealthIndicator healthIndicator) {
3636
return new HealthIndicatorReactiveAdapter(healthIndicator);
3737
}
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);
4239
}
4340

4441
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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;

spring-boot-project/spring-boot-health/src/test/java/org/springframework/boot/health/ReactiveHealthContributorTests.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
import static org.assertj.core.api.Assertions.assertThat;
2424
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
25-
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
26-
import static org.mockito.Mockito.mock;
2725

2826
/**
2927
* Tests for {@link ReactiveHealthContributor}.
@@ -57,11 +55,4 @@ void adaptWhenCompositeHealthContributorReturnsCompositeHealthContributorReactiv
5755
assertThat(((ReactiveHealthIndicator) contained).health().block().getStatus()).isEqualTo(Status.OUT_OF_SERVICE);
5856
}
5957

60-
@Test
61-
void adaptWhenUnknownThrowsException() {
62-
assertThatIllegalStateException()
63-
.isThrownBy(() -> ReactiveHealthContributor.adapt(mock(HealthContributor.class)))
64-
.withMessage("Unknown HealthContributor type");
65-
}
66-
6758
}

spring-boot-project/spring-boot-jms/src/test/java/org/springframework/boot/jms/actuate/health/JmsHealthIndicatorTests.java

Lines changed: 0 additions & 143 deletions
This file was deleted.

0 commit comments

Comments
 (0)