Skip to content

Commit f680582

Browse files
wilkinsonaphilwebb
authored andcommitted
Create spring-boot-cloudfoundry module
1 parent 1d26046 commit f680582

File tree

59 files changed

+279
-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

+279
-168
lines changed

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ include "spring-boot-project:spring-boot-autoconfigure"
5252
include "spring-boot-project:spring-boot-batch"
5353
include "spring-boot-project:spring-boot-cache"
5454
include "spring-boot-project:spring-boot-cassandra"
55+
include "spring-boot-project:spring-boot-cloudfoundry"
5556
include "spring-boot-project:spring-boot-couchbase"
5657
include "spring-boot-project:spring-boot-data-cassandra"
5758
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
@@ -104,12 +104,12 @@ dependencies {
104104
testImplementation(project(":spring-boot-project:spring-boot-web-server-test"))
105105
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-metrics")))
106106
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server")))
107+
testImplementation("com.squareup.okhttp3:mockwebserver")
107108
testImplementation("io.micrometer:micrometer-observation-test")
108109
testImplementation("io.micrometer:micrometer-registry-prometheus")
109110
testImplementation("io.opentelemetry:opentelemetry-exporter-common")
110111
testImplementation("io.projectreactor:reactor-test")
111112
testImplementation("io.prometheus:prometheus-metrics-exposition-formats")
112-
testImplementation("com.squareup.okhttp3:mockwebserver")
113113
testImplementation("jakarta.xml.bind:jakarta.xml.bind-api")
114114
testImplementation("org.apache.activemq:artemis-jakarta-client")
115115
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: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
plugins {
2+
id "java-library"
3+
id "org.springframework.boot.auto-configuration"
4+
id "org.springframework.boot.deployed"
5+
id "org.springframework.boot.optional-dependencies"
6+
}
7+
8+
description = "Spring Boot Cloud Foundry"
9+
10+
dependencies {
11+
api(project(":spring-boot-project:spring-boot"))
12+
api(project(":spring-boot-project:spring-boot-actuator"))
13+
api(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
14+
15+
implementation(project(":spring-boot-project:spring-boot-security"))
16+
17+
optional(project(":spring-boot-project:spring-boot-restclient"))
18+
optional(project(":spring-boot-project:spring-boot-webclient"))
19+
optional(project(":spring-boot-project:spring-boot-webflux"))
20+
optional(project(":spring-boot-project:spring-boot-webmvc"))
21+
optional("io.projectreactor:reactor-core")
22+
optional("io.projectreactor.netty:reactor-netty-http")
23+
optional("jakarta.servlet:jakarta.servlet-api")
24+
25+
testImplementation(project(":spring-boot-project:spring-boot-http-converter"))
26+
testImplementation(project(":spring-boot-project:spring-boot-jackson"))
27+
testImplementation(project(":spring-boot-project:spring-boot-reactor-netty"))
28+
testImplementation(project(":spring-boot-project:spring-boot-restclient-test"))
29+
testImplementation(project(":spring-boot-project:spring-boot-test"))
30+
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
31+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
32+
testImplementation("com.squareup.okhttp3:mockwebserver")
33+
testImplementation("io.projectreactor:reactor-test")
34+
testImplementation("org.springframework.security:spring-security-test")
35+
36+
testRuntimeOnly("ch.qos.logback:logback-classic")
37+
}
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)