LdapUserService implements UserService { @Override public void delete(String userName) { throw new UnsupportedOperationException("LdapUserService does not implement Delete."); } LdapUserService(Config config);  LdapUserService(DirContext context, String[] userAttributes); @Override String create(User user); @Override void delete(String userName); @Override User getUser(String userName); @Override String retrieve(Properties properties); @Override void update(String userName, User user);  }
@Test(expected = UnsupportedOperationException.class) public void testDeleteMethod() throws NamingException { DirContext ctx = mock(InitialDirContext.class); String[] userAttributes = mockUserAttributes(); LdapUserService lus = new LdapUserService(ctx, userAttributes); lus.delete(mockUser().getUserName()); }