for (String username : new String[]{"john", "peter", "fred", "margaret", "paul"}) {
final String password = username.substring(0, 2) + username.substring(0, 2);
final String salt = "this is a salt";
User user1 = new User();
user1.setUsername(username);
user1.setHash(password);
user1.setSalt(salt);
dao.createUser(user1);
final User user2 = dao.getUser(username, password, salt);
assertNull(dao.getUser(username, "foobah", salt));
assertEquals(user2.getUsername(), username);
assertNotSame(user2.getHash(), password);
}
}