@Test
public void testGetMembership() {

    ZMSClient client = createClient(systemAdminUser);
    ZMSRDLGeneratedClient c = Mockito.mock(ZMSRDLGeneratedClient.class);
    client.setZMSRDLGeneratedClient(c);
    Membership member1Mock = Mockito.mock(Membership.class);
    Mockito.when(c.getMembership("MbrGetRoleDom1", "Role1", "user.joe", null)).thenReturn(member1Mock);
    client.getMembership("MbrGetRoleDom1", "Role1", "user.doe");
    try {
        Mockito.when(c.getMembership("MbrGetRoleDom1", "Role2", "user.joe", null)).thenThrow(new ResourceException(204));
        client.getMembership("MbrGetRoleDom1", "Role2", "user.joe");
        fail();
    } catch  (ResourceException ex) {
        assertTrue(true);
    }
    try {
        Mockito.when(c.getMembership("MbrGetRoleDom1", "Role3", "user.joe", null)).thenThrow(new NullPointerException());
        client.getMembership("MbrGetRoleDom1", "Role3", "user.joe");
        fail();
    } catch (ResourceException ex) {
        assertTrue(true);
    }
}