@Test
public void testPutTenantResourceGroupRoles() {

    ZMSClient client = createClient(systemAdminUser);
    ZMSRDLGeneratedClient c = Mockito.mock(ZMSRDLGeneratedClient.class);
    client.setZMSRDLGeneratedClient(c);
    TenantResourceGroupRoles tenantRoles = new TenantResourceGroupRoles();
    try {
        Mockito.when(c.putTenantResourceGroupRoles("ProvidorDomain1", "ProvidorService1", "TenantDom1",
                "ResourceGroup1", AUDIT_REF, tenantRoles)).thenThrow(new NullPointerException());
        client.putTenantResourceGroupRoles("ProvidorDomain1", "ProvidorService1", "TenantDom1", "ResourceGroup1",
                AUDIT_REF, tenantRoles);
        fail();
    } catch (ResourceException ex) {
        assertTrue(true);
    }
    try {
        Mockito.when(c.putTenantResourceGroupRoles("ProvidorDomain2", "ProvidorService1", "TenantDom1",
                "ResourceGroup1", AUDIT_REF, tenantRoles)).thenThrow(new ResourceException(400));
        client.putTenantResourceGroupRoles("ProvidorDomain2", "ProvidorService1", "TenantDom1", "ResourceGroup1",
                AUDIT_REF, tenantRoles);
        fail();
    } catch (ResourceException ex) {
        assertTrue(true);
    }
}