package at.procon.dip; import org.testcontainers.containers.PostgreSQLContainer; public class FixedPortPostgreSQLContainer> extends PostgreSQLContainer { private final int hostPort; public FixedPortPostgreSQLContainer(String imageName, int hostPort) { super(imageName); this.hostPort = hostPort; } @Override protected void configure() { super.configure(); addFixedExposedPort(hostPort, PostgreSQLContainer.POSTGRESQL_PORT); } }