Search in sources :

Example 6 with CertPolicyGroup

use of org.nhind.config.CertPolicyGroup in project nhin-d by DirectProject.

the class ClientProxyCertificatePolicyTest method cleanUp.

@Before
public void cleanUp() throws Exception {
    Domain[] domains = proxy.listDomains(null, 1000);
    int idx = 0;
    Long[] ids;
    if (domains != null)
        for (Domain domain : domains) proxy.removeDomainById(domain.getId());
    CertPolicy[] retrievedPolicies = proxy.getPolicies();
    if (retrievedPolicies != null && retrievedPolicies.length > 0) {
        idx = 0;
        ids = new Long[retrievedPolicies.length];
        for (CertPolicy policy : retrievedPolicies) ids[idx++] = policy.getId();
        proxy.deletePolicies(ids);
    }
    CertPolicyGroup[] retrievedGroups = proxy.getPolicyGroups();
    if (retrievedGroups != null && retrievedGroups.length > 0) {
        idx = 0;
        ids = new Long[retrievedGroups.length];
        for (CertPolicyGroup group : retrievedGroups) ids[idx++] = group.getId();
        proxy.deletePolicyGroups(ids);
    }
}
Also used : CertPolicy(org.nhind.config.CertPolicy) CertPolicyGroup(org.nhind.config.CertPolicyGroup) Domain(org.nhind.config.Domain) Before(org.junit.Before)

Aggregations

CertPolicy (org.nhind.config.CertPolicy)6 CertPolicyGroup (org.nhind.config.CertPolicyGroup)6 Test (org.junit.Test)5 Domain (org.nhind.config.Domain)4 CertPolicyGroupDomainReltn (org.nhind.config.CertPolicyGroupDomainReltn)3 Before (org.junit.Before)1