Answer the question
In order to leave comments, you need to log in
DBUnit - how to clear a table?
You need to write 2 tests for the method working with the database. The first one claims that the table has rows, it needs a state of the table with rows. The second asserts that there are no rows in the table, so an empty table is needed for a successful test.
The getDataSet() method sets the same state of the table for each of the testing methods, either a table with rows or an empty table, one of the two.
And for me, for tests of the same method, it is necessary that there are rows in the table for the first test, and not for the second.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question