TestContainers is absolutely revolutionary given its integration with Java and Spring
@rieckpil Жыл бұрын
Great talk, Oleg 🚀
@alexandersmirnov4274 Жыл бұрын
can we build native images into testcontainers?
@RajkumarRaigonde Жыл бұрын
How to load initial data into database testcontainer if any initial data needs to test?
@jurgen5557 Жыл бұрын
I give you the concrete answer for a Spring boot application: just put a schema.sql or init.sql on your classpath, have Spring use it by setting property: "spring.sql.init.mode=always" => then when your application start up the ApplicationContext with a DatabaseContainer, it makes sure, that the init-scripts are run. If you use another technology, you may have to start the sql-execution in the tests manually - but you can do that, since at test execution time your DB-Container accepts connections when container is properly registered...
@putinscat1208 Жыл бұрын
Docker has the ability to run a script file on initialization.. I don't know if Test Containers can tap into that.