assertNull("found user but did not expect it", user);
}
@Test
public void save() {
SyncopeUser user = new SyncopeUser();
user.setUsername("username");
user.setCreationDate(new Date());
user.setPassword("pass", CipherAlgorithm.SHA256, 0);
Throwable t = null;
try {
userDAO.save(user);
} catch (InvalidEntityException e) {
t = e;
}
assertNotNull(t);
user.setPassword("password", CipherAlgorithm.SHA256, 1);
user.setUsername("username!");
t = null;
try {
userDAO.save(user);
} catch (InvalidEntityException e) {
t = e;
}
assertNotNull(t);
user.setUsername("username");
SyncopeUser actual = userDAO.save(user);
assertNotNull("expected save to work", actual);
assertEquals(1, actual.getPasswordHistory().size());
}