Skip to content

Improved Support for Default use & clearing of tables

Compare
Choose a tag to compare
@ed0906 ed0906 released this 05 Oct 13:43
· 18 commits to main since this release

Rows in Tables can now be created using only defaults e.g.

dbunit.givenDataSet(
  Table(
    "table-name",
    Row(emptyList())
  )
)

or for file based:

<?xml version="1.0" encoding="UTF-8"?>
<dataset>
    <demo id="[ID]" name="[NAME]"/> // All columns need to be specified
</dataset>

As long as there is a default configured for each mandatory column in 'table-name' then a row will be created using those


Tables can also be cleared programatically using

dbunit.givenDataSet(
  Table("table-name")     // Or Table("table-name", emptyList())
)