Move Redis testcontainers support into spring-boot-data-redis
See gh-46126
This commit is contained in:
parent
9887066be6
commit
ba0a189d51
|
@ -38,14 +38,15 @@ dependencies {
|
|||
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(project(":spring-boot-project:spring-boot-testcontainers"))
|
||||
optional("com.redis:testcontainers-redis")
|
||||
optional("redis.clients:jedis")
|
||||
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
|
||||
dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
|
||||
dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-testcontainers")))
|
||||
dockerTestImplementation("ch.qos.logback:logback-classic")
|
||||
dockerTestImplementation("com.redis:testcontainers-redis")
|
||||
dockerTestImplementation("org.junit.jupiter:junit-jupiter")
|
||||
dockerTestImplementation("org.testcontainers:junit-jupiter")
|
||||
|
||||
testCompileOnly("com.fasterxml.jackson.core:jackson-annotations")
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.testcontainers.service.connection.redis;
|
||||
package org.springframework.boot.data.redis.testcontainers;
|
||||
|
||||
import java.util.Map;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.testcontainers.service.connection.redis;
|
||||
package org.springframework.boot.data.redis.testcontainers;
|
||||
|
||||
import com.redis.testcontainers.RedisContainer;
|
||||
import org.junit.jupiter.api.Test;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.testcontainers.service.connection.redis;
|
||||
package org.springframework.boot.data.redis.testcontainers;
|
||||
|
||||
import com.redis.testcontainers.RedisStackContainer;
|
||||
import org.junit.jupiter.api.Test;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.testcontainers.service.connection.redis;
|
||||
package org.springframework.boot.data.redis.testcontainers;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<include resource="org/springframework/boot/logging/logback/base.xml"/>
|
||||
</configuration>
|
|
@ -0,0 +1 @@
|
|||
spring.test.context.cache.maxSize=1
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.testcontainers.service.connection.redis;
|
||||
package org.springframework.boot.data.redis.testcontainers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -54,8 +54,10 @@ class RedisContainerConnectionDetailsFactory
|
|||
protected boolean sourceAccepts(ContainerConnectionSource<Container<?>> source, Class<?> requiredContainerType,
|
||||
Class<?> requiredConnectionDetailsType) {
|
||||
return super.sourceAccepts(source, requiredContainerType, requiredConnectionDetailsType)
|
||||
|| source.accepts(ANY_CONNECTION_NAME, RedisContainer.class, requiredConnectionDetailsType)
|
||||
|| source.accepts(ANY_CONNECTION_NAME, RedisStackContainer.class, requiredConnectionDetailsType);
|
||||
|| source.accepts(ContainerConnectionDetailsFactory.ANY_CONNECTION_NAME, RedisContainer.class,
|
||||
requiredConnectionDetailsType)
|
||||
|| source.accepts(ContainerConnectionDetailsFactory.ANY_CONNECTION_NAME, RedisStackContainer.class,
|
||||
requiredConnectionDetailsType);
|
||||
}
|
||||
|
||||
@Override
|
|
@ -17,4 +17,4 @@
|
|||
/**
|
||||
* Support for testcontainers Redis service connections.
|
||||
*/
|
||||
package org.springframework.boot.testcontainers.service.connection.redis;
|
||||
package org.springframework.boot.data.redis.testcontainers;
|
|
@ -1,3 +1,7 @@
|
|||
# Connection Details Factories
|
||||
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
|
||||
org.springframework.boot.data.redis.testcontainers.RedisContainerConnectionDetailsFactory
|
||||
|
||||
# Failure Analyzers
|
||||
org.springframework.boot.diagnostics.FailureAnalyzer=\
|
||||
org.springframework.boot.data.redis.autoconfigure.RedisUrlSyntaxFailureAnalyzer
|
||||
|
|
|
@ -41,23 +41,17 @@ dependencies {
|
|||
dockerTestImplementation("org.junit.platform:junit-platform-launcher")
|
||||
dockerTestImplementation("org.mockito:mockito-core")
|
||||
dockerTestImplementation("org.springframework:spring-core-test")
|
||||
dockerTestImplementation("org.springframework.data:spring-data-redis")
|
||||
dockerTestImplementation("org.testcontainers:junit-jupiter")
|
||||
|
||||
dockerTestRuntimeOnly("io.lettuce:lettuce-core")
|
||||
|
||||
optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure-all"))
|
||||
optional(project(":spring-boot-project:spring-boot-data-redis"))
|
||||
optional(project(":spring-boot-project:spring-boot-tx"))
|
||||
optional("org.springframework:spring-test")
|
||||
optional("org.testcontainers:grafana")
|
||||
optional("com.redis:testcontainers-redis")
|
||||
|
||||
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-testcontainers")))
|
||||
testImplementation("org.springframework:spring-jdbc")
|
||||
testImplementation("org.springframework.data:spring-data-redis")
|
||||
testImplementation("org.testcontainers:junit-jupiter")
|
||||
}
|
||||
|
||||
|
|
|
@ -6,5 +6,4 @@ org.springframework.boot.testcontainers.service.connection.otlp.GrafanaOpenTelem
|
|||
org.springframework.boot.testcontainers.service.connection.otlp.OpenTelemetryLoggingContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.otlp.OpenTelemetryMetricsContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.otlp.OpenTelemetryTracingContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.redis.RedisContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.zipkin.ZipkinContainerConnectionDetailsFactory
|
||||
|
|
|
@ -45,7 +45,7 @@ dependencies {
|
|||
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-data-redis"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-testcontainers-all"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
|
||||
dockerTestImplementation("com.redis:testcontainers-redis")
|
||||
dockerTestImplementation("org.testcontainers:junit-jupiter")
|
||||
|
|
|
@ -25,7 +25,7 @@ dependencies {
|
|||
dockerTestImplementation(project(":spring-boot-project:spring-boot-reactor"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-testcontainers-all"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
|
||||
dockerTestImplementation("com.redis:testcontainers-redis")
|
||||
dockerTestImplementation("io.projectreactor:reactor-test")
|
||||
|
|
|
@ -22,7 +22,7 @@ plugins {
|
|||
description = "Spring Boot Session Mongodb smoke test"
|
||||
|
||||
dependencies {
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-testcontainers-all"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
|
||||
dockerTestImplementation("com.redis:testcontainers-redis")
|
||||
|
|
|
@ -23,7 +23,7 @@ description = "Spring Boot Session WebFlux Redis smoke test"
|
|||
|
||||
dependencies {
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-testcontainers-all"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
|
||||
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
|
||||
dockerTestImplementation("com.redis:testcontainers-redis")
|
||||
dockerTestImplementation("org.testcontainers:junit-jupiter")
|
||||
|
|
Loading…
Reference in New Issue