ZMSFileChangeLogStore implements ChangeLogStore { public ZMSClient getZMSClient() { PrincipalToken token = new PrincipalToken.Builder("S1", ATHENZ_SYS_DOMAIN, ZTS_SERVICE) .expirationWindow(24 * 60 * 60L).keyId(privateKeyId).build(); token.sign(privateKey); Principal principal = SimplePrincipal.create(ATHENZ_SYS_DOMAIN, ZTS_SERVICE, token.getSignedToken(), authority); ZMSClient zmsClient = new ZMSClient(zmsUrl); zmsClient.addCredentials(principal); return zmsClient; } ZMSFileChangeLogStore(String rootDirectory, PrivateKey privateKey, String privateKeyId); @Override boolean supportsFullRefresh(); @Override SignedDomain getLocalSignedDomain(String domainName); @Override SignedDomain getServerSignedDomain(String domainName); @Override void removeLocalDomain(String domainName); @Override void saveLocalDomain(String domainName, SignedDomain signedDomain); @Override List<String> getLocalDomainList(); ZMSClient getZMSClient(); @Override Set<String> getServerDomainList(); @Override SignedDomains getServerDomainModifiedList(); @Override void setLastModificationTimestamp(String newLastModTime); @Override SignedDomains getUpdatedSignedDomains(StringBuilder lastModTimeBuffer); void setChangeLogStoreCommon(ZMSFileChangeLogStoreCommon changeLogStoreCommon);  }
@Test public void testGetZMSClient() { File privKeyFile = new File("src/test/resources/unit_test_zts_private.pem"); final String privKey = Crypto.encodedFile(privKeyFile); PrivateKey privateKey = Crypto.loadPrivateKey(Crypto.ybase64DecodeString(privKey)); ZMSFileChangeLogStore fstore = new ZMSFileChangeLogStore(FSTORE_PATH, privateKey, "0"); ZMSClient zmsClient = fstore.getZMSClient(); assertNotNull(zmsClient); }