zonkyio / embedded-database-spring-test

A library for creating isolated embedded databases for Spring-powered integration tests.
Apache License 2.0
399 stars 37 forks source link

Add possibility to make reusable containers #185

Open iirekm opened 2 years ago

iirekm commented 2 years ago

Test containers library has recently added support for withReuse(true), which makes test startup faster, unfortunately I can't find any way to enable this option in this library.

tomix26 commented 2 years ago

It should already be possible to enable this option using a container customizer. Just add a bean implementing io.zonky.test.db.provider.postgres.PostgreSQLContainerCustomizer, io.zonky.test.db.provider.mssql.MSSQLServerContainerCustomizer, io.zonky.test.db.provider.mysql.MySQLContainerCustomizer or io.zonky.test.db.provider.mariadb.MariaDBContainerCustomizer based on the database you are currently using.

tomix26 commented 2 years ago

More information is here: https://github.com/zonkyio/embedded-database-spring-test#docker-provider-specific-configuration