I annotate my test methods like this:
@Test
@DatabaseSetup("/default_database_data.xml")
@ExpectedDatabase(value = "/expected_database_1.xml", assertionMode = NON_STRICT)
is it possible to manually perform the things that @DatabaseSetup and @ExpectedDatabase does:
@Test
public void test(){
// DBUnit.setup("/default_database_data.xml");
dao.insert(...);
// DBUnit.expected("/expected_database_1.xml");
}
I made the syntax up, just to give you an idea of what I need: perform 2 setups and assertions in one unit test.
two things that might work, check this link.
Link
And also this annotation:
@DirtiesContext(classMode=ClassMode.AFTER_EACH_TEST_METHOD)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With