liquibase initialization with r2dbc config shows how to set up R2DBC with Liquibase. I want to create a test using test containers.
@DataR2dbcTest(properties = [
"spring.datasource.url: jdbc:tc:mysql://mysql/gateway?TC_IMAGE_TAG=8",
"spring.r2dbc.url: r2dbc:tc:mysql://mysql/gateway?TC_IMAGE_TAG=8"])
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
@ContextConfiguration(classes = [
Application::class,
LiquibaseAutoConfiguration::class // this didn't work either
])
class ApplicationR2dbcTests {
@Autowired lateinit var applicationContext: ApplicationContext
...
}
Combining the knowledge from the following answers: