I'm trying to do the following;
but using org.testcontainers.containers.MySQLR2DBCDatabaseContainer
can anyone show me how this can be achieved, as MySQLR2DBCDatabaseContainer doesn't seem to have the following methods:
- ::getJdbcUrl
- ::getPassword
- ::getUsername
@Testcontainers
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class ApplicationIT {
@Container
public static PostgreSQLContainer postgreSQLContainer = new PostgreSQLContainer()
.withPassword("inmemory")
.withUsername("inmemory");
@DynamicPropertySource
static void postgresqlProperties(DynamicPropertyRegistry registry) {
registry.add("spring.datasource.url", postgreSQLContainer::getJdbcUrl);
registry.add("spring.datasource.password", postgreSQLContainer::getPassword);
registry.add("spring.datasource.username", postgreSQLContainer::getUsername);
}
@Test
public void contextLoads() {
}
}