Releases: camassia-io/spring-boot-test-dbunit
Dependency Version Increments
Allow Java 11 consumers
Ensures the full project lifecycle is done with Java 11 to avoid any discrepancies in target version
Allow Java 11 consumers
Reduces the Target Compatibility version down to Java 11
Maven Central Release
Publishes the project to Sonatype Nexus (Maven Central)
Improved Support for Default use & clearing of tables
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())
)
Support DatabaseSetup and Teardown annotations on nested class hierarchy
When using a test class hierarchy, previously only the test method + class containing the test method could be annotated with @DatabaseSetup
or @DatabaseTeardown
.
As of this change the parent, grandparent, great grandparent etc of the test method can have the annotations too.
Remember to use the operation = DatabaseOperation.INSERT
option on child level annotations though if adding to the same table at different stages.
This stops the data already in the table getting wiped once a new operation on that table is made at a lower level.
Templated val improvements
Improves the conventions for templated vals
- Doesn't treat json arrays as a templated variable name
- Templated variable names now need to follow a certain pattern
[A-Za-z0-9_\-]+
Error or emit Warn log if an Override isn't used
By default going forwards if a user specifies an Override that isn't used then an exception will be thrown.
This can be changed to a warn log with spring.dbunit.fail_on_unused_overrides=false
This should help avoid & highlight typos in tests
Version upgrades
Java 17, Gradle 7.4.2, dbunit 2.7.3
Bug fix for when a missing Override fell back to a null default
Previously an exception would be thrown. Now the null
default is used.