@Test
public void testUpdateTemplatePolicy() {

    Policy policy = createPolicyObject("_domain_", "policy1",
            "role1", true, "read", "_domain_:*", AssertionEffect.ALLOW);
    
    Policy newPolicy = zms.dbService.updateTemplatePolicy(policy, "athenz", null);
    
    assertEquals("athenz:policy.policy1", newPolicy.getName());
    List<Assertion> assertions = newPolicy.getAssertions();
    assertEquals(1, assertions.size());
    Assertion assertion = assertions.get(0);
    assertEquals("athenz:role.role1", assertion.getRole());
    assertEquals("athenz:*", assertion.getResource());
    assertEquals("read", assertion.getAction());
    assertEquals(AssertionEffect.ALLOW, assertion.getEffect());
}