Use the container IP address for tests using TestContainer

See gh-21480
This commit is contained in:
olivier lamy
2020-05-16 17:09:03 +10:00
committed by Stephane Nicoll
parent afcb5d54b2
commit 0c2bf70bb8
5 changed files with 13 additions and 6 deletions

View File

@@ -61,6 +61,7 @@ class DataRedisTestIntegrationTests {
@DynamicPropertySource
static void redisProperties(DynamicPropertyRegistry registry) {
registry.add("spring.redis.port", redis::getFirstMappedPort);
registry.add("spring.redis.host", redis::getContainerIpAddress);
}
@Test

View File

@@ -50,6 +50,7 @@ class DataRedisTestWithIncludeFilterIntegrationTests {
@DynamicPropertySource
static void redisProperties(DynamicPropertyRegistry registry) {
registry.add("spring.redis.port", redis::getFirstMappedPort);
registry.add("spring.redis.host", redis::getContainerIpAddress);
}
@Test