Skip to content

Commit f78ec43

Browse files
committed
Merge branch '3.3.x'
Closes gh-41891
2 parents e3f4844 + d4762ec commit f78ec43

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

Diff for: spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/sbom/SbomEndpointAutoConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ SbomEndpoint sbomEndpoint(ResourceLoader resourceLoader) {
5555
@Bean
5656
@ConditionalOnMissingBean
5757
@ConditionalOnBean(SbomEndpoint.class)
58-
@ConditionalOnAvailableEndpoint(exposure = EndpointExposure.WEB)
58+
@ConditionalOnAvailableEndpoint(exposure = { EndpointExposure.WEB, EndpointExposure.CLOUD_FOUNDRY })
5959
SbomEndpointWebExtension sbomEndpointWebExtension(SbomEndpoint sbomEndpoint) {
6060
return new SbomEndpointWebExtension(sbomEndpoint, this.properties);
6161
}

Diff for: spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/sbom/SbomEndpointAutoConfigurationTests.java

+12-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,19 @@ class SbomEndpointAutoConfigurationTests {
3636
.withConfiguration(AutoConfigurations.of(SbomEndpointAutoConfiguration.class));
3737

3838
@Test
39-
void runShouldHaveEndpointBean() {
39+
void runWhenWebExposedShouldHaveEndpointBeanAndWebExtension() {
4040
this.contextRunner.withPropertyValues("management.endpoints.web.exposure.include=sbom")
41-
.run((context) -> assertThat(context).hasSingleBean(SbomEndpoint.class));
41+
.run((context) -> assertThat(context).hasSingleBean(SbomEndpoint.class)
42+
.hasSingleBean(SbomEndpointWebExtension.class));
43+
}
44+
45+
@Test
46+
void runWhenCloudFoundryExposedShouldHaveEndpointBeanAndWebExtension() {
47+
this.contextRunner
48+
.withPropertyValues("management.endpoints.cloud-foundry.exposure.include=sbom",
49+
"spring.main.cloud-platform=cloud_foundry")
50+
.run((context) -> assertThat(context).hasSingleBean(SbomEndpoint.class)
51+
.hasSingleBean(SbomEndpointWebExtension.class));
4252
}
4353

4454
@Test

0 commit comments

Comments
 (0)