//录制脚本
EasyMock.expect(mockAccountManager.findUserByLoginName("admin")).andReturn(user);
control.replay();
//执行测试
OperatorDetails operator = (OperatorDetails) userDetailsService.loadUserByUsername(user.getLoginName());
//校验结果
assertEquals(user.getLoginName(), operator.getUsername());
assertEquals(new ShaPasswordEncoder().encodePassword("admin", null), operator.getPassword());
assertEquals(2, operator.getAuthorities().size());
assertEquals(new GrantedAuthorityImpl("ROLE_admin"), operator.getAuthorities().iterator().next());
assertNotNull(operator.getLoginTime());
}