org.testcontainers.Testcontainers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of testcontainers Show documentation
Show all versions of testcontainers Show documentation
Isolated container management for Java code testing
package org.testcontainers;
import lombok.experimental.UtilityClass;
import org.testcontainers.containers.PortForwardingContainer;
import java.util.Map;
import java.util.Map.Entry;
@UtilityClass
public class Testcontainers {
public void exposeHostPorts(int... ports) {
for (int port : ports) {
PortForwardingContainer.INSTANCE.exposeHostPort(port);
}
}
public void exposeHostPorts(Map ports) {
for (Entry entry : ports.entrySet()) {
PortForwardingContainer.INSTANCE.exposeHostPort(entry.getKey(), entry.getValue());
}
}
}