ZMSClient implements Closeable { public void putTenantResourceGroupRoles(String providerDomain, String providerServiceName, String tenantDomain, String resourceGroup, String auditRef, TenantResourceGroupRoles tenantRoles) { updatePrincipal(); try { client.putTenantResourceGroupRoles(providerDomain, providerServiceName, tenantDomain, resourceGroup, auditRef, tenantRoles); } catch (ResourceException ex) { throw new ZMSClientException(ex.getCode(), ex.getData()); } catch (Exception ex) { throw new ZMSClientException(ZMSClientException.BAD_REQUEST, ex.getMessage()); } } ZMSClient();  ZMSClient(String url);  ZMSClient(String url, Principal identity);  ZMSClient(Principal identity);  ZMSClient(String url, SSLContext sslContext); void close(); void setProperty(String name, Object value); void setZMSRDLGeneratedClient(ZMSRDLGeneratedClient client); void addCredentials(String credHeader, String credToken); ZMSClient addCredentials(Principal identity); ZMSClient clearCredentials(); String getZmsUrl(); String generateRoleName(String domain, String role); String generatePolicyName(String domain, String policy); String generateServiceIdentityName(String domain, String service); Domain getDomain(String domain); JWSDomain getJWSDomain(String domain); DomainList getDomainList(); DomainList getDomainList(Integer limit, String skip, String prefix, Integer depth,
                                    String account, Integer productId, Date modifiedSince); DomainList getDomainList(String roleMember, String roleName); Domain postTopLevelDomain(String auditRef, TopLevelDomain detail); Domain postSubDomain(String parent, String auditRef, SubDomain detail); Domain postUserDomain(String name, String auditRef, UserDomain detail); void deleteTopLevelDomain(String name, String auditRef); void deleteSubDomain(String parent, String name, String auditRef); void deleteUserDomain(String name, String auditRef); void putDomainMeta(String name, String auditRef, DomainMeta detail); void putDomainSystemMeta(String name, String attribute, String auditRef, DomainMeta detail); RoleList getRoleList(String domainName); RoleList getRoleList(String domainName, Integer limit, String skip); Roles getRoles(String domainName, Boolean members); Role getRole(String domainName, String roleName); Role getRole(String domainName, String roleName, boolean auditLog); Role getRole(String domainName, String roleName, boolean auditLog, boolean expand); Role getRole(String domainName, String roleName, boolean auditLog, boolean expand, boolean pending); void putRole(String domainName, String roleName, String auditRef, Role role); void deleteRole(String domainName, String roleName, String auditRef); Membership getMembership(String domainName, String roleName, String memberName); Membership getMembership(String domainName, String roleName, String memberName, String expiration); DomainRoleMembers getOverdueReview(String domainName); void putMembership(String domainName, String roleName, String memberName, String auditRef); void putMembership(String domainName, String roleName, String memberName,
                              Timestamp expiration, String auditRef); void putMembershipWithReview(String domainName, String roleName, String memberName,
                              Timestamp expiration, Timestamp review, String auditRef); void deleteMembership(String domainName, String roleName, String memberName, String auditRef); void deletePendingMembership(String domainName, String roleName, String memberName, String auditRef); UserList getUserList(); void deleteUser(String name, String auditRef); Policies getPolicies(String domainName, Boolean assertions); PolicyList getPolicyList(String domainName); PolicyList getPolicyList(String domainName, Integer limit, String skip); Assertion getAssertion(String domainName, String policyName, Long assertionId); Assertion putAssertion(String domainName, String policyName, String auditRef, Assertion assertion); void deleteAssertion(String domainName, String policyName, Long assertionId, String auditRef); Policy getPolicy(String domainName, String policyName); void putPolicy(String domainName, String policyName, String auditRef, Policy policy); void deletePolicy(String domainName, String policyName, String auditRef); void putServiceIdentity(String domainName, String serviceName,
                                   String auditRef, ServiceIdentity service); void putServiceIdentitySystemMeta(String domainName, String serviceName,
                                             String attribute, String auditRef, ServiceIdentitySystemMeta meta); ServiceIdentity getServiceIdentity(String domainName, String serviceName); void deleteServiceIdentity(String domainName, String serviceName, String auditRef); ServiceIdentities getServiceIdentities(String domainName, Boolean publicKeys, Boolean hosts); ServiceIdentityList getServiceIdentityList(String domainName); ServiceIdentityList getServiceIdentityList(String domainName, Integer limit, String skip); PublicKeyEntry getPublicKeyEntry(String domainName, String serviceName, String keyId); void putPublicKeyEntry(String domainName, String serviceName, String keyId, String auditRef,
                                  PublicKeyEntry publicKeyEntry); void deletePublicKeyEntry(String domainName, String serviceName, String keyId, String auditRef); void putEntity(String domainName, String entityName, String auditRef, Entity entity); Entity getEntity(String domainName, String entityName); void deleteEntity(String domainName, String entityName, String auditRef); EntityList getEntityList(String domainName); void putTenancy(String tenantDomain, String providerService, String auditRef, Tenancy tenant); void deleteTenancy(String tenantDomain, String providerService, String auditRef); void putTenant(String providerDomain, String providerService, String tenantDomain, String auditRef, Tenancy tenant); void deleteTenant(String providerDomain, String providerService, String tenantDomain, String auditRef); void putTenantResourceGroupRoles(String providerDomain, String providerServiceName, String tenantDomain,
                                            String resourceGroup, String auditRef, TenantResourceGroupRoles tenantRoles); TenantResourceGroupRoles getTenantResourceGroupRoles(String providerDomain, String providerServiceName,
                                                                String tenantDomain, String resourceGroup); void deleteTenantResourceGroupRoles(String providerDomain, String providerServiceName, String tenantDomain,
                                               String resourceGroup, String auditRef); Access getAccess(String action, String resource, String trustDomain); Access getAccess(String action, String resource, String trustDomain, String principal); Access getAccessExt(String action, String resource, String trustDomain, String principal); SignedDomains getSignedDomains(String domainName, String metaOnly, String matchingTag,
                                          Map<String, List<String>> responseHeaders); SignedDomains getSignedDomains(String domainName, String metaOnly, String metaAttr,
                                          String matchingTag, Map<String, List<String>> responseHeaders); SignedDomains getSignedDomains(String domainName, String metaOnly, String metaAttr,
                                          boolean masterCopy, String matchingTag, Map<String, List<String>> responseHeaders); UserToken getUserToken(String userName); UserToken getUserToken(String userName, String serviceNames, Boolean header); UserToken getUserToken(String userName, String serviceNames); void putDefaultAdmins(String domainName, String auditRef, DefaultAdmins defaultAdmins); Principal getPrincipal(String serviceToken); Principal getPrincipal(String serviceToken, String tokenHeader); void putProviderResourceGroupRoles(String tenantDomain, String providerDomain,
                                              String providerServiceName, String resourceGroup, String auditRef,
                                              ProviderResourceGroupRoles providerRoles); void deleteProviderResourceGroupRoles(String tenantDomain, String providerDomain,
                                                 String providerServiceName, String resourceGroup, String auditRef); ProviderResourceGroupRoles getProviderResourceGroupRoles(String tenantDomain,
                                                                    String providerDomain, String providerServiceName, String resourceGroup); DomainDataCheck getDomainDataCheck(String domain); Template getTemplate(String template); ServerTemplateList getServerTemplateList(); void putDomainTemplate(String domain, String auditRef, DomainTemplate templates); void putDomainTemplateExt(String domain, String template, String auditRef, DomainTemplate templates); void deleteDomainTemplate(String domain, String template, String auditRef); DomainTemplateList getDomainTemplateList(String domain); ResourceAccessList getResourceAccessList(String principal, String action); Quota getQuota(String domainName); void putQuota(String domainName, String auditRef, Quota quota); void deleteQuota(String domainName, String auditRef); void deleteDomainRoleMember(String domainName, String memberName, String auditRef); DomainRoleMembers getDomainRoleMembers(String domainName); DomainRoleMember getPrincipalRoles(String principal, String domainName); void putRoleSystemMeta(String domainName, String roleName, String attribute, String auditRef, RoleSystemMeta meta); void putRoleMeta(String domainName, String roleName, String auditRef, RoleMeta meta); void putMembershipDecision(String domainName, String roleName, String memberName,
                                      Timestamp expiration, boolean approval, String auditRef); DomainRoleMembership getPendingDomainRoleMembersList(String principal); void putRoleReview(String domainName, String roleName, String auditRef, Role role); void deleteGroup(String domainName, String groupName, String auditRef); void deleteGroupMembership(String domainName, String groupName, String memberName, String auditRef); void deletePendingGroupMembership(String domainName, String groupName, String memberName, String auditRef); String generateGroupName(String domain, String group); GroupMembership getGroupMembership(String domainName, String groupName, String memberName, String expiration); DomainGroupMember getPrincipalGroups(String principal, String domainName); void putGroupSystemMeta(String domainName, String groupName, String attribute, String auditRef, GroupSystemMeta meta); void putGroupMeta(String domainName, String groupName, String auditRef, GroupMeta meta); void putGroupMembershipDecision(String domainName, String groupName, String memberName, boolean approval, String auditRef); DomainGroupMembership getPendingDomainGroupMembersList(String principal); void putGroupReview(String domainName, String groupName, String auditRef, Group group); Group getGroup(String domainName, String groupName, boolean auditLog, boolean pending); void putGroup(String domainName, String groupName, String auditRef, Group group); Groups getGroups(String domainName, Boolean members); void putGroupMembership(String domainName, String groupName, String memberName, String auditRef); static final String ZMS_CLIENT_PROP_ATHENZ_CONF; static final String ZMS_CLIENT_PROP_READ_TIMEOUT; static final String ZMS_CLIENT_PROP_CONNECT_TIMEOUT; static final String ZMS_CLIENT_PROP_CERT_ALIAS; static final String ZMS_CLIENT_PROP_KEYSTORE_PATH; static final String ZMS_CLIENT_PROP_KEYSTORE_TYPE; static final String ZMS_CLIENT_PROP_KEYSTORE_PASSWORD; static final String ZMS_CLIENT_PROP_KEYSTORE_PWD_APP_NAME; static final String ZMS_CLIENT_PROP_KEY_MANAGER_PASSWORD; static final String ZMS_CLIENT_PROP_KEY_MANAGER_PWD_APP_NAME; static final String ZMS_CLIENT_PROP_TRUSTSTORE_PATH; static final String ZMS_CLIENT_PROP_TRUSTSTORE_TYPE; static final String ZMS_CLIENT_PROP_TRUSTSTORE_PASSWORD; static final String ZMS_CLIENT_PROP_TRUSTSTORE_PWD_APP_NAME; static final String ZMS_CLIENT_PROP_PRIVATE_KEY_STORE_FACTORY_CLASS; static final String ZMS_CLIENT_PROP_CLIENT_PROTOCOL; static final String ZMS_CLIENT_PKEY_STORE_FACTORY_CLASS; static final String ZMS_CLIENT_DEFAULT_CLIENT_SSL_PROTOCOL; }
@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); } }