Skip to content

Strategies for "cleaning up" after each test #157

Answered by dasniko
blevine asked this question in Q&A
Discussion options

You must be logged in to vote

Not really a bullet-proof suggestion, but you can try to setup the testcontainer as usual with private static void..., doing all the basic configurations you need, but do not import a realm.
Then, in a @Before annotated method, import/init the realm through admin API as desired, in an @After annotated method, remove the realm again through admin API. This way, you'll have a new fresh realm for each test method. Give it a try.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@blevine
Comment options

Answer selected by blevine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants