Currently, I want to create an integration test for my system. I'm using testcontainers to spawn my temporary database instance, and use R2DBC Database to make my system reactive. The problem is I don't know how to create a schema in R2DBC testcontainer instance, there's clear difference in the documentation between R2DBC support and JDBC support in testcontainers web page. In JDBC, there're section to create schema after we replace JDBC URL, meanwhile in R2DBC there isn't any mention about schema creation after we replace R2DBC URL. I've tried and explored the method in PostgreSQLR2DBCDatabaseContainer
, but it didn't work.
I'm also use spring boot for our system's framework, and usually I replace the URL using ContextConfiguration
initializer. Is there any way to create a schema after I replace the URL for R2DBC?