diff --git a/settings.gradle b/settings.gradle index f4b592b958..5188957be8 100644 --- a/settings.gradle +++ b/settings.gradle @@ -46,6 +46,7 @@ include "spring-boot-project:spring-boot-actuator-autoconfigure" include "spring-boot-project:spring-boot-actuator-autoconfigure-all" include "spring-boot-project:spring-boot-actuator-docs" include "spring-boot-project:spring-boot-actuator-integration-tests" +include "spring-boot-project:spring-boot-actuator-test-support" include "spring-boot-project:spring-boot-amqp" include "spring-boot-project:spring-boot-artemis" include "spring-boot-project:spring-boot-autoconfigure" diff --git a/spring-boot-project/spring-boot-actuator-integration-tests/build.gradle b/spring-boot-project/spring-boot-actuator-integration-tests/build.gradle index b8810d668a..2ea447acb8 100644 --- a/spring-boot-project/spring-boot-actuator-integration-tests/build.gradle +++ b/spring-boot-project/spring-boot-actuator-integration-tests/build.gradle @@ -1,25 +1,13 @@ plugins { id "java-library" - id "java-test-fixtures" } description = "Spring Boot Actuator Integration Tests" dependencies { - testFixturesImplementation(project(":spring-boot-project:spring-boot-actuator")) - testFixturesImplementation(project(":spring-boot-project:spring-boot-autoconfigure")) - testFixturesImplementation(project(":spring-boot-project:spring-boot-http-converter")) - testFixturesImplementation(project(":spring-boot-project:spring-boot-jackson")) - testFixturesImplementation(project(":spring-boot-project:spring-boot-jersey")) - testFixturesImplementation(project(":spring-boot-project:spring-boot-reactor-netty")) - testFixturesImplementation(project(":spring-boot-project:spring-boot-test")) - testFixturesImplementation(project(":spring-boot-project:spring-boot-tomcat")) - testFixturesImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) - testFixturesImplementation(project(":spring-boot-project:spring-boot-webflux")) - testFixturesImplementation(project(":spring-boot-project:spring-boot-webmvc")) - testFixturesImplementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") testImplementation(project(":spring-boot-project:spring-boot-actuator")) + testImplementation(project(":spring-boot-project:spring-boot-actuator-test-support")) testImplementation(project(":spring-boot-project:spring-boot-autoconfigure")) testImplementation(project(":spring-boot-project:spring-boot-http-converter")) testImplementation(project(":spring-boot-project:spring-boot-jackson")) diff --git a/spring-boot-project/spring-boot-actuator-test-support/build.gradle b/spring-boot-project/spring-boot-actuator-test-support/build.gradle new file mode 100644 index 0000000000..6476e35c67 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-test-support/build.gradle @@ -0,0 +1,37 @@ +plugins { + id "java-library" + id "org.springframework.boot.optional-dependencies" +} + +description = "Spring Boot Actuator Testing Support" + +dependencies { + api(project(":spring-boot-project:spring-boot-actuator")) + api(project(":spring-boot-project:spring-boot-autoconfigure")) + api(project(":spring-boot-project:spring-boot-http-converter")) + api(project(":spring-boot-project:spring-boot-jackson")) + api(project(":spring-boot-project:spring-boot-jersey")) + api(project(":spring-boot-project:spring-boot-reactor-netty")) + api(project(":spring-boot-project:spring-boot-test")) + api(project(":spring-boot-project:spring-boot-tomcat")) + api(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + api(project(":spring-boot-project:spring-boot-webflux")) + api(project(":spring-boot-project:spring-boot-webmvc")) + api("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") + api("com.jayway.jsonpath:json-path") + api("org.assertj:assertj-core") + api("org.awaitility:awaitility") + api("org.hamcrest:hamcrest-core") + api("org.hamcrest:hamcrest-library") + api("org.junit.jupiter:junit-jupiter") + api("org.mockito:mockito-core") + api("org.mockito:mockito-junit-jupiter") + api("org.skyscreamer:jsonassert") + api("org.springframework:spring-core") + api("org.springframework:spring-test") + api("org.springframework:spring-core-test") + + compileOnly("org.junit.platform:junit-platform-engine") + compileOnly("org.junit.platform:junit-platform-launcher") + compileOnly("org.springframework:spring-context") +} diff --git a/spring-boot-project/spring-boot-actuator-integration-tests/src/testFixtures/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTest.java b/spring-boot-project/spring-boot-actuator-test-support/src/main/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTest.java similarity index 97% rename from spring-boot-project/spring-boot-actuator-integration-tests/src/testFixtures/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTest.java rename to spring-boot-project/spring-boot-actuator-test-support/src/main/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTest.java index 86ffbea6cb..a34a38739d 100644 --- a/spring-boot-project/spring-boot-actuator-integration-tests/src/testFixtures/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTest.java +++ b/spring-boot-project/spring-boot-actuator-test-support/src/main/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,9 +31,10 @@ import org.springframework.context.ConfigurableApplicationContext; /** * Signals that a test should be run against one or more of the web endpoint - * infrastructure implementations (Jersey, Web MVC, and WebFlux) + * infrastructure implementations (Jersey, Web MVC, and WebFlux). * * @author Andy Wilkinson + * @since 4.0.0 */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) diff --git a/spring-boot-project/spring-boot-actuator-integration-tests/src/testFixtures/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java b/spring-boot-project/spring-boot-actuator-test-support/src/main/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java similarity index 100% rename from spring-boot-project/spring-boot-actuator-integration-tests/src/testFixtures/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java rename to spring-boot-project/spring-boot-actuator-test-support/src/main/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java diff --git a/spring-boot-project/spring-boot-actuator-test-support/src/main/java/org/springframework/boot/actuate/endpoint/web/test/package-info.java b/spring-boot-project/spring-boot-actuator-test-support/src/main/java/org/springframework/boot/actuate/endpoint/web/test/package-info.java new file mode 100644 index 0000000000..290341385a --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-test-support/src/main/java/org/springframework/boot/actuate/endpoint/web/test/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2012-2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Support for testing endpoints against one or more of the web endpoint infrastructure + * implementations. + */ +package org.springframework.boot.actuate.endpoint.web.test; diff --git a/spring-boot-project/spring-boot-cache/build.gradle b/spring-boot-project/spring-boot-cache/build.gradle index a771d26a69..cfcbb700c1 100644 --- a/spring-boot-project/spring-boot-cache/build.gradle +++ b/spring-boot-project/spring-boot-cache/build.gradle @@ -44,9 +44,9 @@ dependencies { dockerTestImplementation("org.testcontainers:junit-jupiter") dockerTestImplementation("org.testcontainers:testcontainers") + testImplementation(project(":spring-boot-project:spring-boot-actuator-test-support")) testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) - testImplementation(testFixtures(project(":spring-boot-project:spring-boot-actuator-integration-tests"))) testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure"))) testRuntimeOnly("ch.qos.logback:logback-classic") diff --git a/spring-boot-project/spring-boot-integration/build.gradle b/spring-boot-project/spring-boot-integration/build.gradle index e91d0ed9b7..b2bc88a197 100644 --- a/spring-boot-project/spring-boot-integration/build.gradle +++ b/spring-boot-project/spring-boot-integration/build.gradle @@ -23,11 +23,11 @@ dependencies { optional("org.springframework.integration:spring-integration-jmx") optional("org.springframework.integration:spring-integration-rsocket") + testImplementation(project(":spring-boot-project:spring-boot-actuator-test-support")) testImplementation(project(":spring-boot-project:spring-boot-flyway")) testImplementation(project(":spring-boot-project:spring-boot-rsocket")) testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) - testImplementation(testFixtures(project(":spring-boot-project:spring-boot-actuator-integration-tests"))) testImplementation("org.springframework:spring-web") testRuntimeOnly(project(":spring-boot-project:spring-boot-reactor-netty")) diff --git a/spring-boot-project/spring-boot-metrics/build.gradle b/spring-boot-project/spring-boot-metrics/build.gradle index b60dfc5c11..b6ef82b016 100644 --- a/spring-boot-project/spring-boot-metrics/build.gradle +++ b/spring-boot-project/spring-boot-metrics/build.gradle @@ -20,9 +20,9 @@ dependencies { optional("org.apache.logging.log4j:log4j-core") optional("org.aspectj:aspectjweaver") + testImplementation(project(":spring-boot-project:spring-boot-actuator-test-support")) testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) - testImplementation(testFixtures(project(":spring-boot-project:spring-boot-actuator-integration-tests"))) testImplementation("com.fasterxml.jackson.core:jackson-databind") testImplementation("io.micrometer:micrometer-registry-atlas") testImplementation("io.micrometer:micrometer-registry-new-relic") diff --git a/spring-boot-project/spring-boot-quartz/build.gradle b/spring-boot-project/spring-boot-quartz/build.gradle index 4cecc3ac99..60d77c14d4 100644 --- a/spring-boot-project/spring-boot-quartz/build.gradle +++ b/spring-boot-project/spring-boot-quartz/build.gradle @@ -20,11 +20,11 @@ dependencies { optional(project(":spring-boot-project:spring-boot-jdbc")) optional(project(":spring-boot-project:spring-boot-jpa")) + testImplementation(project(":spring-boot-project:spring-boot-actuator-test-support")) testImplementation(project(":spring-boot-project:spring-boot-flyway")) testImplementation(project(":spring-boot-project:spring-boot-liquibase")) testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) - testImplementation(testFixtures(project(":spring-boot-project:spring-boot-actuator-integration-tests"))) testImplementation("net.minidev:json-smart") testImplementation("org.springframework:spring-web") diff --git a/spring-boot-project/spring-boot-session/build.gradle b/spring-boot-project/spring-boot-session/build.gradle index 7b624470ff..e0c32e3a1c 100644 --- a/spring-boot-project/spring-boot-session/build.gradle +++ b/spring-boot-project/spring-boot-session/build.gradle @@ -28,11 +28,11 @@ dependencies { testFixturesImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testFixturesImplementation("io.projectreactor:reactor-core") + testImplementation(project(":spring-boot-project:spring-boot-actuator-test-support")) testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tomcat")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testImplementation(project(":spring-boot-project:spring-boot-webflux")) - testImplementation(testFixtures(project(":spring-boot-project:spring-boot-actuator-integration-tests"))) testImplementation(testFixtures(project(":spring-boot-project:spring-boot-web-server"))) testImplementation("net.minidev:json-smart") testImplementation("io.projectreactor:reactor-test")