@Test
public void testGetPolicyList() {

    
    List<com.yahoo.athenz.zms.Policy> policies = new ArrayList<>();
    List<com.yahoo.athenz.zms.Assertion> assertions = new ArrayList<>();
    
    com.yahoo.athenz.zms.Policy policy = new com.yahoo.athenz.zms.Policy();
    com.yahoo.athenz.zms.Assertion assertion = new com.yahoo.athenz.zms.Assertion();
    assertion.setResource("coretech:tenant.weather.*");
    assertion.setAction("read");
    assertion.setRole("coretech:role.readers");
    assertions.add(assertion);
    
    policy.setAssertions(assertions);
    policy.setName("coretech:policy.reader");
    policies.add(policy);
    
    policy = new com.yahoo.athenz.zms.Policy();
    assertion = new com.yahoo.athenz.zms.Assertion();
    assertion.setResource("coretech:tenant.weather.*");
    assertion.setAction("write");
    assertion.setRole("coretech:role.writers");
    assertions.add(assertion);
    
    policy.setAssertions(assertions);
    policy.setName("coretech:policy.writer");
    policies.add(policy);
    com.yahoo.athenz.zms.DomainPolicies domainPolicies = new com.yahoo.athenz.zms.DomainPolicies();
    domainPolicies.setDomain("coretech");
    domainPolicies.setPolicies(policies);
    
    com.yahoo.athenz.zms.SignedPolicies signedPolicies = new com.yahoo.athenz.zms.SignedPolicies();
    signedPolicies.setContents(domainPolicies);
    signedPolicies.setSignature(Crypto.sign(SignUtils.asCanonicalString(domainPolicies), privateKey));
    signedPolicies.setKeyId("0");
    
    DomainData domain = new DomainData();
    domain.setName("coretech");
    domain.setPolicies(signedPolicies);
    domain.setModified(Timestamp.fromCurrentTime());
    
    List<com.yahoo.athenz.zts.Policy> policyList = zts.getPolicyList(domain);
    assertEquals(policyList.size(), 2);
    assertEquals(policyList.get(0).getName(), "coretech:policy.reader");
    assertEquals(policyList.get(1).getName(), "coretech:policy.writer");
}