ZMSUtils { public static String getProviderResourceGroupRolePrefix(String provSvcDomain, String provSvcName, String resourceGroup) { StringBuilder rolePrefix = new StringBuilder(256); rolePrefix.append(provSvcDomain).append('.').append(provSvcName).append('.'); if (resourceGroup != null) { rolePrefix.append("res_group.").append(resourceGroup).append('.'); } return rolePrefix.toString(); }  static void addAssertion(Policy policy, String resource, String action, String role,
            AssertionEffect effect); static Role makeAdminRole(String domainName, List<String> adminUsers); static Policy makeAdminPolicy(String domainName, Role adminsRole); static String roleResourceName(String domainName, String roleName); static String groupResourceName(String domainName, String groupName); static String policyResourceName(String domainName, String policyName); static String serviceResourceName(String domainName, String serviceName); static String entityResourceName(String domainName, String serviceName); static String removeDomainPrefix(String objectName, String domainName, String objectPrefix); static String removeDomainPrefixForService(String serviceName, String domainName); static String getTenantResourceGroupRolePrefix(String provSvcName, String tenantDomain, String resourceGroup); static String getProviderResourceGroupRolePrefix(String provSvcDomain, String provSvcName, String resourceGroup); static String getTrustedResourceGroupRolePrefix(String provSvcDomain, String provSvcName,
            String tenantDomain, String resourceGroup); static List<String> convertRoleMembersToMembers(List<RoleMember> members); static List<RoleMember> convertMembersToRoleMembers(List<String> members); static AuditLogMsgBuilder getAuditLogMsgBuilder(ResourceContext ctx,
            AuditLogger auditLogger, String domainName, String auditRef, String caller,
            String method); static RuntimeException error(int code, String msg, String caller); static RuntimeException requestError(String msg, String caller); static RuntimeException unauthorizedError(String msg, String caller); static RuntimeException forbiddenError(String msg, String caller); static RuntimeException notFoundError(String msg, String caller); static RuntimeException internalServerError(String msg, String caller); static RuntimeException quotaLimitError(String msg, String caller); static boolean emitMonmetricError(int errorCode, String caller); static void threadSleep(long millis); static boolean parseBoolean(final String value, boolean defaultValue); static Principal.Type principalType(final String memberName, final String userDomainPrefix,
                                               final List<String> addlUserCheckDomainPrefixList); static boolean isUserDomainPrincipal(final String memberName, final String userDomainPrefix,
            final List<String> addlUserCheckDomainPrefixList); static String extractObjectName(String domainName, String fullName, String objType); static String extractRoleName(String domainName, String fullRoleName); static String extractGroupName(String domainName, String fullGroupName); static String extractPolicyName(String domainName, String fullPolicyName); static String extractServiceName(String domainName, String fullServiceName); static boolean isUserAuthorityFilterValid(Authority userAuthority, final String filterList, final String memberName); static String combineUserAuthorityFilters(final String roleUserAuthorityFilter, final String domainUserAuthorityFilter); static String lowerDomainInResource(String resource); static boolean userAuthorityAttrMissing(final String origAttrList, final String checkAttrList);  }
@Test public void testGetProviderResourceGroupRolePrefix() { assertEquals("sports.hosted.res_group.hockey.", ZMSUtils.getProviderResourceGroupRolePrefix("sports", "hosted", "hockey")); assertEquals("sports.hosted.", ZMSUtils.getProviderResourceGroupRolePrefix("sports", "hosted", null)); }