I am using DbUnit for integration tests. I have the following dataset.
<?xml version='1.0' encoding='UTF-8'?>
<dataset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="dataset.xsd">
<USERS ID="1" EMAIL="" LASTNAME="A" LASTMODIFIED="2001-01-01 00:00:00.0" />
<USERS ID="2" EMAIL="" LASTNAME="D" LASTMODIFIED="2001-01-01 00:00:00.0" ACTIVE="true" />
</dataset>
Somehow, the ACTIVE logical field is not set on the second user when I load it from the database into my test.
The test is as follows:
@SpringApplicationContext("component-context-test-dao.xml")
@DataSet
public class UserDaoImplIT extends UnitilsJUnit4 {
@SpringBeanByType
private UserDaoImpl userDao;
@Test
public void shouldReturnTrueIfFoundActiveUserWithEmail() throws InterruptedException {
boolean exits = userDao.isEmailFromActiveUserInUsers("anEmailThatDoesNotExist@oeamtc.at");
List list = HibernateUnitils.getSession().createQuery("from User").list();
assertThat(exits, is(true));
}
}
I run a test from inside an eclipse against h2 in memory.
Any ideas that show all fields except the logical?
source
share