I have a junit
test, making use of testcontainers-1.15.1
. How can I start an explicit image? Because:
@SpringBootTest
public class ContainerTest {
private final JdbcDatabaseContainer DB = new MariaDBContainer("mariadb:10.5.8");
static {
DB.start();
}
@Test
public void test() {
}
}
Result: the default 10.3.6
container is started.
[][] 2021-02-04 14:32:50,741 INFO ?.3.6]: Creating container for image: mariadb:10.3.6
[][] 2021-02-04 14:32:51,597 INFO ?.3.6]: Container mariadb:10.3.6 is starting: d9ccf77f4b9165ccd1690ee5cb8437f43e7d853dfe5121d468a391d67eccef7d
application.properties
:
spring.datasource.url=jdbc:tc:mariadb:///test
spring.datasource.username=test
spring.datasource.password=test