@Test
public void testGetProviderResourceGroupRoles() {

    String tenantDomain = "getproviderresourcegrouproles";
    TopLevelDomain dom = createTopLevelDomainObject(tenantDomain, "Test Domain1", "testOrg", adminUser);
    zms.postTopLevelDomain(mockDomRsrcCtx, auditRef, dom);
    List<TenantRoleAction> roleActions = new ArrayList<>();
    for (Struct.Field f : RESOURCE_PROVIDER_ROLE_ACTIONS) {
        roleActions.add(new TenantRoleAction().setRole(f.name()).setAction(
                (String) f.value()));
    }
    String providerService  = "storage";
    String providerDomain = "coretech";
    String resourceGroup = "hockey";
    
    ProviderResourceGroupRoles providerRoles = new ProviderResourceGroupRoles()
            .setDomain(providerDomain).setService(providerService)
            .setTenant(tenantDomain).setRoles(roleActions)
            .setResourceGroup(resourceGroup);
    zms.putProviderResourceGroupRoles(mockDomRsrcCtx, tenantDomain, providerDomain, providerService,
            resourceGroup, auditRef, providerRoles);
    ProviderResourceGroupRoles tRoles = zms.getProviderResourceGroupRoles(mockDomRsrcCtx,
            tenantDomain, providerDomain, providerService, resourceGroup);
    
    assertNotNull(tRoles);
    assertEquals(providerDomain.toLowerCase(), tRoles.getDomain());
    assertEquals(providerService.toLowerCase(), tRoles.getService());
    assertEquals(tenantDomain.toLowerCase(), tRoles.getTenant());
    assertEquals(resourceGroup.toLowerCase(), tRoles.getResourceGroup());
    assertEquals(RESOURCE_PROVIDER_ROLE_ACTIONS.size(), tRoles.getRoles().size());
    List<TenantRoleAction> traList = tRoles.getRoles();
    List<String> roles = new ArrayList<>();
    for (TenantRoleAction ra : traList) {
        roles.add(ra.getRole());
    }
    assertTrue(roles.contains("reader"));
    assertTrue(roles.contains("writer"));
    
    zms.deleteTopLevelDomain(mockDomRsrcCtx, tenantDomain, auditRef);
}