@Test
public void TestPolicyUpdater() throws Exception {

    
    PolicyUpdaterConfiguration configuration = new PolicyUpdaterConfiguration();
    configuration.init(pathToAthenzConfigFile, pathToZPUTestConfigFile);
    configuration.setPolicyFileDir(configuration.getRootDir() + TEST_POLICY_DIR);
    configuration.setPolicyFileTmpDir(configuration.getRootDir() + TEST_POLICY_TEMP_DIR);
    DebugZTSClientFactory ztsFactory = new DebugZTSClientFactory();
    ztsFactory.setPublicKeyId("0");
    PolicyUpdater.policyUpdater(configuration, ztsFactory);
    
    Path path = Paths.get(configuration.getRootDir() + TEST_POLICY_DIR
            + File.separator + "sports.pol");
    DomainSignedPolicyData domainPolicySignedData =
            JSON.fromBytes(Files.readAllBytes(path), DomainSignedPolicyData.class);
    
    // Validate that the SignedPolicy written to target/classes is correct,
    // return value is true when policies are correctly validated
    Assert.assertTrue(PolicyUpdater.validateSignedPolicies(null, configuration,
            domainPolicySignedData, "sports"));
     
    Files.delete(path);
    
    path = Paths.get(configuration.getRootDir() + TEST_POLICY_DIR + File.separator + "sys.auth.pol");
    domainPolicySignedData = JSON.fromBytes(Files.readAllBytes(path), DomainSignedPolicyData.class);
    
    // Validate that the SignedPolicy written to target/classes is correct,
    // return value is true when policies are correctly validated
    Assert.assertTrue(PolicyUpdater.validateSignedPolicies(null, configuration,
            domainPolicySignedData, "sys.auth.pol"));
    
    Files.delete(path);
}