You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have been using H2 for our test suite and we are planning to migrate to TestContainer only problem is that we have some test cases especially the ones that involving @Async blocks within that when executed it pollutes the database records so we used to backup the database in a @BeforeEach and then restore it back in an @AfterEach
Doing so in H2 was pretty easy and fast using SCRIPT TO scriptPath in @BeforeEach and DROP ALL OBJECTS, RUNSCRIPT FROM scriptPath in @AfterEach
I was trying to do the same idea some stuff like @BeforeEach > postgreSQLContainer.execInContainer("pg_dump", "-U" , "test" , "-w" , "-Fc","-d", "test", "-f", "/tmp/backup");
Activity
[-]Fixing data pollution[/-][+]Fixing data pollution between tests[/+]