UserServiceImpl implements UserService { @Override public User findByUserName( final String userName ) { return this.userDao.findByUserName( userName ); }  @Override void addGroupAuthority( UserGroup group, String authority ); @Override void addUserToGroup( UserGroup group, User user ); @Override User create( final User user ); @Override UserGroup create( UserGroup group ); @Override void delete( User user ); @Override void delete( UserGroup group ); @Override User findByEmail( final String email ); @Override User findByUserName( final String userName ); @Override UserGroup findGroupByName( String name ); @Override boolean groupExists( String name ); @Override Collection<UserGroup> findGroupsForUser( User user ); @Override Collection<UserGroup> listAvailableGroups(); @Override User load( final Long id ); @Override Collection<User> loadAll(); @Override Collection<GroupAuthority> loadGroupAuthorities( User user ); @Override void removeGroupAuthority( UserGroup group, String authority ); @Override void removeUserFromGroup( User user, UserGroup group ); @Override void update( final User user ); @Override void update( UserGroup group );  }
@Test public void testHandleGetUser() { userDaoMock.findByUserName( "foobar" ); expectLastCall().andReturn( testUser ); replay( userDaoMock ); userService.findByUserName( "foobar" ); verify( userDaoMock ); }