use of org.testcontainers.containers.MySQLContainer.MYSQL_PORT in project hazelcast by hazelcast.
the class MySqlCdcNetworkIntegrationTest method initMySql.
private MySQLContainer<?> initMySql(Network network, Integer fixedExposedPort) {
MySQLContainer<?> mysql = namedTestContainer(new MySQLContainer<>(AbstractMySqlCdcIntegrationTest.DOCKER_IMAGE).withUsername("mysqluser").withPassword("mysqlpw"));
if (fixedExposedPort != null) {
Consumer<CreateContainerCmd> cmd = e -> e.withPortBindings(new PortBinding(Ports.Binding.bindPort(fixedExposedPort), new ExposedPort(MYSQL_PORT)));
mysql = mysql.withCreateContainerCmdModifier(cmd);
}
if (network != null) {
mysql = mysql.withNetwork(network);
}
mysql.start();
return mysql;
}
Aggregations