DataStore implements DataCacheProvider, RolesProvider { public void processDomainChecks() { SignedDomains signedDomains = changeLogStore.getServerDomainModifiedList(); if (signedDomains == null) { return; } for (SignedDomain zmsDomain : signedDomains.getDomains()) { final DomainData domainData = zmsDomain.getDomain(); DomainData localDomain = getDomainData(domainData.getName()); if (localDomain == null || localDomain.getModified().millis() < domainData.getModified().millis()) { SignedDomain signedDomain = changeLogStore.getServerSignedDomain(domainData.getName()); if (signedDomain == null) { continue; } processDomain(signedDomain, true); } } } DataStore(ChangeLogStore clogStore, CloudStore cloudStore); JWKList getZtsJWKList(Boolean rfc); void init(); boolean processDomain(SignedDomain signedDomain, boolean saveInStore); boolean processDomainDeletes(); void processDomainChecks(); boolean processDomainUpdates(); DomainData getDomainData(String name); void addDomainToCache(String name, DataCache dataCache); @Override DataCache getDataCache(String domainName); List<GroupMember> getGroupMembers(final String groupName); void getAccessibleRoles(DataCache data, String domainName, String identity,
            String[] requestedRoleList, Set<String> accessibleRoles, boolean keepFullName); String getPublicKey(String domain, String service, String keyId); HostServices getHostServices(String host); CloudStore getCloudStore(); void setCloudStore(CloudStore cloudStore); Cache<String, DataCache> getCacheStore(); Map<String, String> getPublicKeyCache(); @Override List<Role> getRolesByDomain(String domain);  }
@Test public void testProcessDomainChecks() { MockZMSFileChangeLogStore clogStore = new MockZMSFileChangeLogStore("/tmp/zts_server_unit_tests/zts_root", pkey, "0"); DataStore store = new DataStore(clogStore, null); addDomainToDataStore(store, "coretech"); clogStore.setSignedDomains(null); store.processDomainChecks(); List<SignedDomain> domains = new ArrayList<>(); SignedDomain signedDomain = createSignedDomain("sports", "weather"); domains.add(signedDomain); SignedDomains signedDomains = new SignedDomains(); signedDomains.setDomains(domains); clogStore.setSignedDomains(signedDomains); store.processDomainChecks(); assertNotNull(store.getDomainData("sports")); assertNotNull(store.getDomainData("coretech")); }