public void authenticateSuccessfully() {
mockery.checking(new Expectations() {{
oneOf(userDao).findByName("admin");
will(returnValue(new User("admin", "21232f297a57a5a743894a0e4a801fc3")));
}});
User user = authenticator.authenticate("admin", "admin");
assertNotNull(user);
assertEquals(user.getName(), "admin");
assertEquals(user.getPassword(), "21232f297a57a5a743894a0e4a801fc3");
}