Polish "Use the container IP address for tests using TestContainer"

See gh-21480
This commit is contained in:
Stephane Nicoll
2020-05-25 14:13:26 +02:00
parent 0c2bf70bb8
commit 77981ac2ae
5 changed files with 7 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 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.
@@ -54,7 +54,8 @@ class RedisRepositoriesAutoConfigurationTests {
@BeforeEach
void setUp() {
TestPropertyValues.of("spring.redis.port=" + redis.getFirstMappedPort()).applyTo(this.context.getEnvironment());
TestPropertyValues.of("spring.redis.host=" + redis.getContainerIpAddress(),
"spring.redis.port=" + redis.getFirstMappedPort()).applyTo(this.context.getEnvironment());
}
@AfterEach

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 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.