diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfiguration.java index 2a75103033..15e46321a3 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfiguration.java @@ -19,13 +19,13 @@ package org.springframework.boot.actuate.autoconfigure.data.redis; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; -import org.springframework.boot.actuate.data.redis.RedisHealthIndicator; import org.springframework.boot.actuate.health.HealthContributor; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.data.redis.actuate.health.RedisHealthIndicator; import org.springframework.context.annotation.Bean; import org.springframework.data.redis.connection.RedisConnectionFactory; @@ -40,7 +40,7 @@ import org.springframework.data.redis.connection.RedisConnectionFactory; */ @AutoConfiguration(after = RedisReactiveHealthContributorAutoConfiguration.class, afterName = "org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration") -@ConditionalOnClass(RedisConnectionFactory.class) +@ConditionalOnClass({ RedisConnectionFactory.class, RedisHealthIndicator.class }) @ConditionalOnBean(RedisConnectionFactory.class) @ConditionalOnEnabledHealthIndicator("redis") public class RedisHealthContributorAutoConfiguration diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfiguration.java index 2f22a65422..0cfce348b4 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfiguration.java @@ -21,13 +21,13 @@ import reactor.core.publisher.Flux; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; -import org.springframework.boot.actuate.data.redis.RedisReactiveHealthIndicator; import org.springframework.boot.actuate.health.ReactiveHealthContributor; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.data.redis.actuate.health.RedisReactiveHealthIndicator; import org.springframework.context.annotation.Bean; import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory; @@ -42,7 +42,7 @@ import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory; * @since 2.1.0 */ @AutoConfiguration(afterName = "org.springframework.boot.data.redis.autoconfigure.RedisReactiveAutoConfiguration") -@ConditionalOnClass({ ReactiveRedisConnectionFactory.class, Flux.class }) +@ConditionalOnClass({ ReactiveRedisConnectionFactory.class, Flux.class, RedisReactiveHealthIndicator.class }) @ConditionalOnBean(ReactiveRedisConnectionFactory.class) @ConditionalOnEnabledHealthIndicator("redis") public class RedisReactiveHealthContributorAutoConfiguration extends diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfigurationTests.java index f5bbfb4966..3241ea6614 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfigurationTests.java @@ -19,9 +19,9 @@ package org.springframework.boot.actuate.autoconfigure.data.redis; import org.junit.jupiter.api.Test; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; -import org.springframework.boot.actuate.data.redis.RedisHealthIndicator; -import org.springframework.boot.actuate.data.redis.RedisReactiveHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfigurations; +import org.springframework.boot.data.redis.actuate.health.RedisHealthIndicator; +import org.springframework.boot.data.redis.actuate.health.RedisReactiveHealthIndicator; import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.testsupport.classpath.ClassPathExclusions; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfigurationTests.java index 7a635bdf18..5961c3e4d6 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfigurationTests.java @@ -19,9 +19,9 @@ package org.springframework.boot.actuate.autoconfigure.data.redis; import org.junit.jupiter.api.Test; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; -import org.springframework.boot.actuate.data.redis.RedisHealthIndicator; -import org.springframework.boot.actuate.data.redis.RedisReactiveHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfigurations; +import org.springframework.boot.data.redis.actuate.health.RedisHealthIndicator; +import org.springframework.boot.data.redis.actuate.health.RedisReactiveHealthIndicator; import org.springframework.boot.data.redis.autoconfigure.RedisAutoConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; diff --git a/spring-boot-project/spring-boot-actuator/build.gradle b/spring-boot-project/spring-boot-actuator/build.gradle index 06ea21e0ba..d28d12a081 100644 --- a/spring-boot-project/spring-boot-actuator/build.gradle +++ b/spring-boot-project/spring-boot-actuator/build.gradle @@ -12,11 +12,10 @@ description = "Spring Boot Actuator" dependencies { api(project(":spring-boot-project:spring-boot")) - dockerTestImplementation(project(":spring-boot-project:spring-boot-autoconfigure-all")) + dockerTestImplementation(project(":spring-boot-project:spring-boot-autoconfigure")) dockerTestImplementation(project(":spring-boot-project:spring-boot-neo4j")) dockerTestImplementation(project(":spring-boot-project:spring-boot-test")) dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker")) - dockerTestImplementation("com.redis:testcontainers-redis") dockerTestImplementation("org.assertj:assertj-core") dockerTestImplementation("org.junit.jupiter:junit-jupiter") dockerTestImplementation("org.springframework:spring-test") @@ -25,7 +24,6 @@ dependencies { dockerTestImplementation("org.testcontainers:testcontainers") optional(project(":spring-boot-project:spring-boot-activemq")) - optional(project(":spring-boot-project:spring-boot-data-redis")) optional(project(":spring-boot-project:spring-boot-flyway")) optional(project(":spring-boot-project:spring-boot-http-converter")) optional(project(":spring-boot-project:spring-boot-integration")) @@ -73,6 +71,7 @@ dependencies { } optional("org.neo4j.driver:neo4j-java-driver") optional("org.quartz-scheduler:quartz") + optional("org.springframework:spring-context-support") optional("org.springframework:spring-jdbc") optional("org.springframework:spring-messaging") optional("org.springframework:spring-webflux") @@ -80,7 +79,6 @@ dependencies { optional("org.springframework:spring-webmvc") optional("org.springframework.graphql:spring-graphql") optional("org.springframework.data:spring-data-ldap") - optional("org.springframework.data:spring-data-redis") optional("org.springframework.data:spring-data-rest-webmvc") optional("org.springframework.security:spring-security-core") optional("org.springframework.security:spring-security-web") @@ -97,7 +95,7 @@ dependencies { testFixturesImplementation(project(":spring-boot-project:spring-boot-webflux")) testFixturesImplementation(project(":spring-boot-project:spring-boot-webmvc")) - testImplementation(project(":spring-boot-project:spring-boot-autoconfigure-all")) + testImplementation(project(":spring-boot-project:spring-boot-autoconfigure")) testImplementation(project(":spring-boot-project:spring-boot-hazelcast")) testImplementation(project(":spring-boot-project:spring-boot-jackson")) testImplementation(project(":spring-boot-project:spring-boot-jersey")) @@ -105,13 +103,13 @@ dependencies { testImplementation(project(":spring-boot-project:spring-boot-reactor-netty")) testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + testImplementation("com.squareup.okhttp3:mockwebserver") testImplementation("io.micrometer:micrometer-observation-test") testImplementation("io.projectreactor:reactor-test") testImplementation("io.r2dbc:r2dbc-h2") testImplementation("net.minidev:json-smart") testImplementation("org.apache.logging.log4j:log4j-to-slf4j") testImplementation("org.glassfish.jersey.media:jersey-media-json-jackson") - testImplementation("com.squareup.okhttp3:mockwebserver") testRuntimeOnly(project(":spring-boot-project:spring-boot-http-codec")) testRuntimeOnly("ch.qos.logback:logback-classic") diff --git a/spring-boot-project/spring-boot-data-redis/build.gradle b/spring-boot-project/spring-boot-data-redis/build.gradle index 1cc3339895..b0e1182c70 100644 --- a/spring-boot-project/spring-boot-data-redis/build.gradle +++ b/spring-boot-project/spring-boot-data-redis/build.gradle @@ -14,8 +14,12 @@ dependencies { api("io.lettuce:lettuce-core") api("org.springframework.data:spring-data-redis") + compileOnly("com.fasterxml.jackson.core:jackson-annotations") + implementation(project(":spring-boot-project:spring-boot-netty")) + optional(project(":spring-boot-project:spring-boot-autoconfigure")) + optional(project(":spring-boot-project:spring-boot-actuator")) optional(project(":spring-boot-project:spring-boot-autoconfigure")) optional("redis.clients:jedis") @@ -27,8 +31,11 @@ dependencies { dockerTestImplementation("org.junit.jupiter:junit-jupiter") dockerTestImplementation("org.testcontainers:junit-jupiter") + testCompileOnly("com.fasterxml.jackson.core:jackson-annotations") + testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + testImplementation("io.projectreactor:reactor-test") testRuntimeOnly("ch.qos.logback:logback-classic") } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealth.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/actuate/health/RedisHealth.java similarity index 93% rename from spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealth.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/actuate/health/RedisHealth.java index ca774f2152..baac43f809 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealth.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/actuate/health/RedisHealth.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.data.redis; +package org.springframework.boot.data.redis.actuate.health; import java.util.Properties; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealthIndicator.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/actuate/health/RedisHealthIndicator.java similarity index 96% rename from spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealthIndicator.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/actuate/health/RedisHealthIndicator.java index 69bd072714..f9f8434b75 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealthIndicator.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/actuate/health/RedisHealthIndicator.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.data.redis; +package org.springframework.boot.data.redis.actuate.health; import org.springframework.boot.actuate.health.AbstractHealthIndicator; import org.springframework.boot.actuate.health.Health; @@ -32,7 +32,7 @@ import org.springframework.util.Assert; * @author Christian Dupuis * @author Richard Santana * @author Scott Frederick - * @since 2.0.0 + * @since 4.0.0 */ public class RedisHealthIndicator extends AbstractHealthIndicator { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisReactiveHealthIndicator.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/actuate/health/RedisReactiveHealthIndicator.java similarity index 95% rename from spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisReactiveHealthIndicator.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/actuate/health/RedisReactiveHealthIndicator.java index 4567e1325e..d5c428f883 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisReactiveHealthIndicator.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/actuate/health/RedisReactiveHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.data.redis; +package org.springframework.boot.data.redis.actuate.health; import java.util.Properties; @@ -36,7 +36,7 @@ import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory; * @author Mark Paluch * @author Artsiom Yudovin * @author Scott Frederick - * @since 2.0.0 + * @since 4.0.0 */ public class RedisReactiveHealthIndicator extends AbstractReactiveHealthIndicator { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/package-info.java b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/actuate/health/package-info.java similarity index 77% rename from spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/package-info.java rename to spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/actuate/health/package-info.java index 2b0a7fbbc7..8aac687579 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/package-info.java +++ b/spring-boot-project/spring-boot-data-redis/src/main/java/org/springframework/boot/data/redis/actuate/health/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 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. @@ -15,6 +15,6 @@ */ /** - * Actuator support for Redis dependent on Spring Data. + * Redis health integration using Spring Data Redis. */ -package org.springframework.boot.actuate.data.redis; +package org.springframework.boot.data.redis.actuate.health; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/redis/RedisHealthIndicatorTests.java b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/actuate/health/RedisHealthIndicatorTests.java similarity index 97% rename from spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/redis/RedisHealthIndicatorTests.java rename to spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/actuate/health/RedisHealthIndicatorTests.java index cfa1f8f01e..b8ba1a5acb 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/redis/RedisHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/actuate/health/RedisHealthIndicatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.redis; +package org.springframework.boot.data.redis.actuate.health; import java.util.Arrays; import java.util.List; @@ -22,7 +22,6 @@ import java.util.Properties; import org.junit.jupiter.api.Test; -import org.springframework.boot.actuate.data.redis.RedisHealthIndicator; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.Status; import org.springframework.data.redis.RedisConnectionFailureException; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/redis/RedisReactiveHealthIndicatorTests.java b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/actuate/health/RedisReactiveHealthIndicatorTests.java similarity index 97% rename from spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/redis/RedisReactiveHealthIndicatorTests.java rename to spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/actuate/health/RedisReactiveHealthIndicatorTests.java index fd6df0c138..5ce89c784f 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/redis/RedisReactiveHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/actuate/health/RedisReactiveHealthIndicatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.redis; +package org.springframework.boot.data.redis.actuate.health; import java.time.Duration; import java.util.Properties; @@ -24,7 +24,6 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; -import org.springframework.boot.actuate.data.redis.RedisReactiveHealthIndicator; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.Status; import org.springframework.data.redis.RedisConnectionFailureException;