Replace getContainerIpAddress by getHost (#783)
`getContainerIpAddress` is deprecated.
This commit is contained in:
committed by
GitHub
parent
601a7d3cea
commit
b1b9c5c68d
@@ -50,7 +50,7 @@ public class ConsulTestcontainers implements ApplicationContextInitializer<Confi
|
||||
Integer mappedPort = consul.getMappedPort(8500);
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put(ConsulProperties.PREFIX + ".port", String.valueOf(mappedPort));
|
||||
map.put(ConsulProperties.PREFIX + ".host", consul.getContainerIpAddress());
|
||||
map.put(ConsulProperties.PREFIX + ".host", consul.getHost());
|
||||
|
||||
sources.addFirst(new MapPropertySource("consulTestcontainer", map));
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class ConsulTestcontainers implements ApplicationContextInitializer<Confi
|
||||
if (!consul.isRunning()) {
|
||||
throw new IllegalStateException("consul Testcontainer is not running");
|
||||
}
|
||||
return consul.getContainerIpAddress();
|
||||
return consul.getHost();
|
||||
}
|
||||
|
||||
public static ConsulClient client() {
|
||||
|
||||
Reference in New Issue
Block a user