@Test
public void testPutGroupMembershipDecision() {

    final String domainName = "put-group-mbr-decision";
    final String groupName = "group1";
    ZMSClient client = createClient(systemAdminUser);
    ZMSRDLGeneratedClient c = Mockito.mock(ZMSRDLGeneratedClient.class);
    client.setZMSRDLGeneratedClient(c);
    Mockito.when(c.putGroupMembershipDecision(anyString(), anyString(), anyString(), anyString(), any(GroupMembership.class)))
            .thenThrow(new NullPointerException())
            .thenThrow(new ResourceException(403));
    try {
        client.putGroupMembershipDecision(domainName, groupName, "user.jane", true, AUDIT_REF);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 400);
    }
    try {
        client.putGroupMembershipDecision(domainName, groupName, "user.jane", true, AUDIT_REF);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 403);
    }
}