(I had a different answer here, which was due to a complete erroneous diagnosis of the problem, as I missed the fact that the OP used FlatXmlDataSet ).
From the FlatXmlDataSet documentation:
Table metadata is derived from the first row of each table by default. Remember that DbUnit might think that a table skips some columns if the first row of this table has one or more null values.
There seems to be a problem here, since the first entry does not indicate a value for active . To avoid this problem, you can use the DBUnit column discovery property, which essentially makes DBUnit fully read XML before displaying the table structure:
FlatXmlDataSetBuilder builder = new FlatXmlDataSetBuilder(); builder.setInputSource(new File("path/to/dataSet.xml")); builder.setColumnSensing(true);
Alternatively, if you yourself do not create a builder and do not want to manipulate it, just make sure that each element has an active column, especially the first one:
<dataset> <client code="0001" name="client_one" active="false" /> <client code="0002" name="client_two" active="true" /> </dataset>
source share