@Test
public void testGetPendingDomainGroupMembersList() {

    ZMSClient client = createClient(systemAdminUser);
    ZMSRDLGeneratedClient c = Mockito.mock(ZMSRDLGeneratedClient.class);
    client.setZMSRDLGeneratedClient(c);
    Mockito.when(c.getPendingDomainGroupMembersList("user.joe"))
            .thenThrow(new ResourceException(403))
            .thenThrow(new NullPointerException());
    try {
        client.getPendingDomainGroupMembersList("user.joe");
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 403);
    }
    try {
        client.getPendingDomainGroupMembersList("user.joe");
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 400);
    }
}