|
|
@ -2022,12 +2022,14 @@ properties. |
|
|
|
class ExampleIntegrationTests { |
|
|
|
class ExampleIntegrationTests { |
|
|
|
|
|
|
|
|
|
|
|
@Container |
|
|
|
@Container |
|
|
|
static RedisContainer redis = new RedisContainer(); |
|
|
|
static GenericContainer redis = |
|
|
|
|
|
|
|
new GenericContainer(DockerImageName.parse("redis:5.0.3-alpine")) |
|
|
|
|
|
|
|
.withExposedPorts(6379); |
|
|
|
|
|
|
|
|
|
|
|
@DynamicPropertySource |
|
|
|
@DynamicPropertySource |
|
|
|
static void redisProperties(DynamicPropertyRegistry registry) { |
|
|
|
static void redisProperties(DynamicPropertyRegistry registry) { |
|
|
|
registry.add("redis.host", redis::getHost); |
|
|
|
registry.add("redis.host", redis::getHost); |
|
|
|
registry.add("redis.port", redis::getMappedPort); |
|
|
|
registry.add("redis.port", redis::getFirstMappedPort); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// tests ... |
|
|
|
// tests ... |
|
|
@ -2045,13 +2047,15 @@ properties. |
|
|
|
|
|
|
|
|
|
|
|
@Container |
|
|
|
@Container |
|
|
|
@JvmStatic |
|
|
|
@JvmStatic |
|
|
|
val redis: RedisContainer = RedisContainer() |
|
|
|
val redis: GenericContainer = |
|
|
|
|
|
|
|
GenericContainer(DockerImageName.parse("redis:5.0.3-alpine")) |
|
|
|
|
|
|
|
.withExposedPorts(6379) |
|
|
|
|
|
|
|
|
|
|
|
@DynamicPropertySource |
|
|
|
@DynamicPropertySource |
|
|
|
@JvmStatic |
|
|
|
@JvmStatic |
|
|
|
fun redisProperties(registry: DynamicPropertyRegistry) { |
|
|
|
fun redisProperties(registry: DynamicPropertyRegistry) { |
|
|
|
registry.add("redis.host", redis::getHost) |
|
|
|
registry.add("redis.host", redis::getHost) |
|
|
|
registry.add("redis.port", redis::getMappedPort) |
|
|
|
registry.add("redis.port", redis::getFirstMappedPort) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|