@Test
public void testDeleteRole() {

    ZMSClient client = createClient(systemAdminUser);
    ZMSRDLGeneratedClient c = Mockito.mock(ZMSRDLGeneratedClient.class);
    client.setZMSRDLGeneratedClient(c);
    Role roleMock = Mockito.mock(Role.class);
    Mockito.when(c.deleteRole("DelRoleDom1", "Role1", AUDIT_REF)).thenReturn(roleMock);
    client.deleteRole("DelRoleDom1", "Role1", AUDIT_REF);
    try {
        Mockito.when(c.deleteRole("DelRoleDom1", "Role2", AUDIT_REF)).thenThrow(new ResourceException(204));
        client.deleteRole("DelRoleDom1", "Role2", AUDIT_REF);
        fail();
    } catch  (ResourceException ex) {
        assertTrue(true);
    }
    try {
        Mockito.when(c.deleteRole("DelRoleDom2", "Role2", AUDIT_REF)).thenThrow(new NullPointerException());
        client.deleteRole("DelRoleDom2", "Role2", AUDIT_REF);
        fail();
    } catch (ResourceException ex) {
        assertTrue(true);
    }
}