diff --git a/settings.gradle b/settings.gradle index 54a0de862e6..b644ffcf7e2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -62,6 +62,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 f008b73de99..636bb118253 100644 --- a/spring-boot-project/spring-boot-actuator-integration-tests/build.gradle +++ b/spring-boot-project/spring-boot-actuator-integration-tests/build.gradle @@ -17,26 +17,14 @@ 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 00000000000..0cb83186808 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-test-support/build.gradle @@ -0,0 +1,54 @@ +/* + * Copyright 2012-present 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. + */ + + +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 99% 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 7d8f05b7b62..f2ca8056c4f 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 @@ -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 00000000000..64d151484a7 --- /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-present 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 aed7ab6ed3d..584bf5735a3 100644 --- a/spring-boot-project/spring-boot-cache/build.gradle +++ b/spring-boot-project/spring-boot-cache/build.gradle @@ -61,9 +61,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 3e29020b4f2..1f0ad6ed9fd 100644 --- a/spring-boot-project/spring-boot-integration/build.gradle +++ b/spring-boot-project/spring-boot-integration/build.gradle @@ -40,11 +40,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 405ba37e2c4..5969ee1f2d9 100644 --- a/spring-boot-project/spring-boot-metrics/build.gradle +++ b/spring-boot-project/spring-boot-metrics/build.gradle @@ -37,9 +37,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 6aef6fce007..c4825106529 100644 --- a/spring-boot-project/spring-boot-quartz/build.gradle +++ b/spring-boot-project/spring-boot-quartz/build.gradle @@ -37,11 +37,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 5a5e160ff09..86730515d42 100644 --- a/spring-boot-project/spring-boot-session/build.gradle +++ b/spring-boot-project/spring-boot-session/build.gradle @@ -45,11 +45,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")