Any ideas how this can be done with Unitils dbunit? Date relative to current in the DBUnit dataset
The problem is that the [create_date]-placeholder is not recognized in @Dataset.
Any ideas how this can be done with Unitils dbunit? Date relative to current in the DBUnit dataset
The problem is that the [create_date]-placeholder is not recognized in @Dataset.
A simple solution might be to just use placeholders in your xml dataset, eg.
<?xml version='1.0' encoding='UTF-8'?> <dataset> <user userName="jdoe" name="doe" firstname="john" lastLogin="{YESTERDAY}" /> <user userName="jdoe" name="doe" firstname="jane" lastLogin="{A_WEEK_AGO}" /> </dataset>
and do some post-processing(replace the placeholders with the calculated values) before you run your tests. When you are using Maven, you could then first execute the post-processing, (fill in the values in the xml-template-dataset, copy the filled-in-xml-dataset to the correct folder), before any tests are executed.