After learning SpringBoot, I wanted go further to handle integration tests using (DBUnit and SpringTestDBUnit). Throughout the process, everything was going well until I came across setting values for boolean datatyped columns on the dataset. (Contents of the dataset is given below)
<?xml version="1.0" encoding="UTF-8"?>
<dataset>
<Client code="0001" name="client_one" />
<Client code="0002" name="client_two" />
<Client code="0003" name="client_three" active="false" />
<Client code="0004" name="client_four" />
</dataset>
Adding active="false"
attribute to Client record [code=0003], my integration tests fails and showing me this message Exception processing table name='Client'
which was resulted the Client record [code=0001] violates the active not null column constraint.
After fixing the error (on branch DBUnit_For_Boolean_Columns_Attempt_One) by supplying values for active column on all records (which is a bit off the specification), it worked. But my target was able to run the integration tests successfully with the dataset written above.
The question is how can the integration tests be successful using the dataset above? As of now, I'm having a hard time implementing solutions so I've created a Bitbucket repository for you to see and help on-hand.
Changelogs
2015/02/04 changes
- Improve question contents
- Added Bitbucket repository
true
orfalse
to the column (for example:active
)? Should it be written on thedataSet.xml
as<Table active="<value>true</value>">
? I forgot to mention, I don't have anapplication-context.xml
since I'm using SpringBoot – Merry