Skip to content

Commit 556bedc

Browse files
wilkinsonaphilwebb
authored andcommitted
Create spring-boot-cloudfoundry module
Issue: 46152
1 parent f25ea67 commit 556bedc

File tree

59 files changed

+296
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+296
-168
lines changed

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ include "spring-boot-project:spring-boot-autoconfigure"
6868
include "spring-boot-project:spring-boot-batch"
6969
include "spring-boot-project:spring-boot-cache"
7070
include "spring-boot-project:spring-boot-cassandra"
71+
include "spring-boot-project:spring-boot-cloudfoundry"
7172
include "spring-boot-project:spring-boot-couchbase"
7273
include "spring-boot-project:spring-boot-data-cassandra"
7374
include "spring-boot-project:spring-boot-data-commons"

spring-boot-project/spring-boot-actuator-autoconfigure-all/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ dependencies {
121121
testImplementation(project(":spring-boot-project:spring-boot-web-server-test"))
122122
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-metrics")))
123123
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
124+
testImplementation("com.squareup.okhttp3:mockwebserver")
124125
testImplementation("io.micrometer:micrometer-observation-test")
125126
testImplementation("io.micrometer:micrometer-registry-prometheus")
126127
testImplementation("io.opentelemetry:opentelemetry-exporter-common")
127128
testImplementation("io.projectreactor:reactor-test")
128129
testImplementation("io.prometheus:prometheus-metrics-exposition-formats")
129-
testImplementation("com.squareup.okhttp3:mockwebserver")
130130
testImplementation("jakarta.xml.bind:jakarta.xml.bind-api")
131131
testImplementation("org.apache.activemq:artemis-jakarta-client")
132132
testImplementation("org.apache.activemq:artemis-jakarta-server")

spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
org.springframework.boot.actuate.autoconfigure.cloudfoundry.reactive.ReactiveCloudFoundryActuatorAutoConfiguration
2-
org.springframework.boot.actuate.autoconfigure.cloudfoundry.servlet.CloudFoundryActuatorAutoConfiguration
31
org.springframework.boot.actuate.autoconfigure.security.reactive.ReactiveManagementWebSecurityAutoConfiguration
42
org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration
53
org.springframework.boot.actuate.autoconfigure.tracing.BraveAutoConfiguration
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# Endpoint Exposure Outcome Contributors
2-
org.springframework.boot.actuate.autoconfigure.endpoint.condition.EndpointExposureOutcomeContributor=\
3-
org.springframework.boot.actuate.autoconfigure.cloudfoundry.CloudFoundryEndpointExposureOutcomeContributor
4-
51
# Failure Analyzers
62
org.springframework.boot.diagnostics.FailureAnalyzer=\
73
org.springframework.boot.actuate.autoconfigure.health.NoSuchHealthContributorFailureAnalyzer

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnAvailableEndpointTests.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,6 @@ void outcomeWithNoEndpointReferenceShouldFail() {
229229
});
230230
}
231231

232-
@Test
233-
void outcomeOnCloudFoundryShouldMatchAll() {
234-
this.contextRunner.withPropertyValues("VCAP_APPLICATION:---")
235-
.run((context) -> assertThat(context).hasBean("info").hasBean("health").hasBean("spring").hasBean("test"));
236-
}
237-
238232
@Test // gh-21044
239233
void outcomeWhenIncludeAllShouldMatchDashedEndpoint() {
240234
this.contextRunner.withUserConfiguration(DashedEndpointConfiguration.class)

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,6 @@ void runWhenWebExposedShouldHaveEndpointBeanAndWebExtension() {
4242
.hasSingleBean(SbomEndpointWebExtension.class));
4343
}
4444

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));
52-
}
53-
5445
@Test
5546
void runWhenNotExposedShouldNotHaveEndpointBean() {
5647
this.contextRunner.run((context) -> assertThat(context).doesNotHaveBean(SbomEndpoint.class));
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright 2012-present 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+
plugins {
19+
id "java-library"
20+
id "org.springframework.boot.auto-configuration"
21+
id "org.springframework.boot.deployed"
22+
id "org.springframework.boot.optional-dependencies"
23+
}
24+
25+
description = "Spring Boot Cloud Foundry"
26+
27+
dependencies {
28+
api(project(":spring-boot-project:spring-boot"))
29+
api(project(":spring-boot-project:spring-boot-actuator"))
30+
api(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
31+
32+
implementation(project(":spring-boot-project:spring-boot-security"))
33+
34+
optional(project(":spring-boot-project:spring-boot-restclient"))
35+
optional(project(":spring-boot-project:spring-boot-webclient"))
36+
optional(project(":spring-boot-project:spring-boot-webflux"))
37+
optional(project(":spring-boot-project:spring-boot-webmvc"))
38+
optional("io.projectreactor:reactor-core")
39+
optional("io.projectreactor.netty:reactor-netty-http")
40+
optional("jakarta.servlet:jakarta.servlet-api")
41+
42+
testImplementation(project(":spring-boot-project:spring-boot-http-converter"))
43+
testImplementation(project(":spring-boot-project:spring-boot-jackson"))
44+
testImplementation(project(":spring-boot-project:spring-boot-reactor-netty"))
45+
testImplementation(project(":spring-boot-project:spring-boot-restclient-test"))
46+
testImplementation(project(":spring-boot-project:spring-boot-test"))
47+
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
48+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
49+
testImplementation("com.squareup.okhttp3:mockwebserver")
50+
testImplementation("io.projectreactor:reactor-test")
51+
testImplementation("org.springframework.security:spring-security-test")
52+
53+
testRuntimeOnly("ch.qos.logback:logback-classic")
54+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.autoconfigure.cloudfoundry;
17+
package org.springframework.boot.cloudfoundry.actuate.autoconfigure;
1818

1919
import java.util.Arrays;
2020
import java.util.List;
@@ -24,7 +24,7 @@
2424
* endpoints.
2525
*
2626
* @author Madhura Bhave
27-
* @since 2.0.0
27+
* @since 4.0.0
2828
*/
2929
public enum AccessLevel {
3030

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.autoconfigure.cloudfoundry;
17+
package org.springframework.boot.cloudfoundry.actuate.autoconfigure;
1818

1919
import org.springframework.http.HttpStatus;
2020

2121
/**
2222
* Authorization exceptions thrown to limit access to the endpoints.
2323
*
2424
* @author Madhura Bhave
25-
* @since 2.0.0
25+
* @since 4.0.0
2626
*/
2727
public class CloudFoundryAuthorizationException extends RuntimeException {
2828

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.autoconfigure.cloudfoundry;
17+
package org.springframework.boot.cloudfoundry.actuate.autoconfigure;
1818

1919
import java.util.Set;
2020

0 commit comments

Comments
 (0)