Class FakeDns
java.lang.Object
io.debezium.testing.testcontainers.util.dns.FakeDns
Fake DNS resolver which allows tests to work well with testcontainer under Docker Desktop
Adaptation of https://github.com/CorfuDB/CorfuDB/blob/master/it/src/main/java/org/corfudb/universe/universe/docker/FakeDns.java
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicBooleanprivate static final FakeDnsstatic final org.slf4j.Loggerprivate final Map<String, InetAddress> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResolution(String hostname, InetAddress ip) disable()Disable the fake DNS registryenable()Enable the fake DNS registrystatic FakeDnsbooleanvoidremoveResolution(String hostname, InetAddress ip) resolve(byte[] address) resolveInternal(byte[] address) private Optional<InetAddress> resolveInternal(String hostname)
-
Field Details
-
LOGGER
public static final org.slf4j.Logger LOGGER -
instance
-
registry
-
enabled
-
-
Constructor Details
-
FakeDns
private FakeDns()
-
-
Method Details
-
getInstance
-
addResolution
-
removeResolution
-
resolve
-
resolve
-
resolveInternal
-
resolveInternal
-
isEnabled
public boolean isEnabled() -
enable
Enable the fake DNS registry -
disable
Disable the fake DNS registry
-