All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.testcontainers.Testcontainers Maven / Gradle / Ivy

There is a newer version: 1.20.3
Show newest version
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());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy