@Test
public void testDeleteTenantResourceGroupRoles() {

    ZMSClient client = createClient(systemAdminUser);
    ZMSRDLGeneratedClient c = Mockito.mock(ZMSRDLGeneratedClient.class);
    client.setZMSRDLGeneratedClient(c);
    TenantResourceGroupRoles tenantRoles = new TenantResourceGroupRoles();
    Mockito.when(c.deleteTenantResourceGroupRoles("ProvidorDomain", "ProvidorService", "TenantDom",
            "ResourceGroup", AUDIT_REF)).thenReturn(tenantRoles);
    client.deleteTenantResourceGroupRoles("ProvidorDomain", "ProvidorService", "TenantDom",
            "ResourceGroup", AUDIT_REF);
    try {
        Mockito.when(c.deleteTenantResourceGroupRoles("ProvidorDomain1", "ProvidorService1", "TenantDom1",
                "ResourceGroup1", AUDIT_REF)).thenThrow(new NullPointerException());
        client.deleteTenantResourceGroupRoles("ProvidorDomain1", "ProvidorService1", "TenantDom1", "ResourceGroup1",
                AUDIT_REF);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 400);
    }
    try {
        Mockito.when(c.deleteTenantResourceGroupRoles("ProvidorDomain2", "ProvidorService1", "TenantDom1",
                "ResourceGroup1", AUDIT_REF)).thenThrow(new ResourceException(401));
        client.deleteTenantResourceGroupRoles("ProvidorDomain2", "ProvidorService1", "TenantDom1", "ResourceGroup1",
                AUDIT_REF);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 401);
    }
}