DefaultUserService implements UserService { @Override public User getUserByLogin(final String login) { return dao.getUserByLogin(login); }  @Override User getUserByLogin(final String login); void setDao(UserDao dao);  }
@Test public void testUserByLogin() throws Exception { String login = "login"; User expected = new User(); expected.setLogin(login); when(dao.getUserByLogin(anyString())).thenReturn(expected); User actual = unit.getUserByLogin(login); verify(dao).getUserByLogin(login); assertEquals(expected, actual); }