Replace getContainerIpAddress by getHost (#783)

`getContainerIpAddress` is deprecated.
This commit is contained in:
Eddú Meléndez Gonzales
2023-01-12 10:43:56 -05:00
committed by GitHub
parent 601a7d3cea
commit b1b9c5c68d

View File

@@ -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() {