@Test
public void testDeleteDomain() {

    ChangeLogStore clogStore = new MockZMSFileChangeLogStore("/tmp/zts_server_unit_tests/zts_root",
            pkey, "0");
    DataStore store = new DataStore(clogStore, null);
    SignedDomain signedDomain = new SignedDomain();
    
    List<Role> roles = new ArrayList<>();
    Role role = new Role();
    role.setName("coretech:role.admin");
    List<RoleMember> members = new ArrayList<>();
    members.add(new RoleMember().setMemberName("user_domain.user"));
    role.setRoleMembers(members);
    
    DomainData domainData = new DomainData();
    domainData.setName("coretech");
    domainData.setRoles(roles);
    
    signedDomain.setDomain(domainData);
    signedDomain.setKeyId("0");
    store.changeLogStore.saveLocalDomain("coretech", signedDomain);
    DataCache dataCache = new DataCache();
    dataCache.setDomainData(domainData);
    
    store.addDomainToCache("coretech", dataCache);
    store.deleteDomainFromCache("coretech");
    store.changeLogStore.removeLocalDomain("coretech");
    
    assertNull(store.getCacheStore().getIfPresent("coretech"));
    
    File file = new File("/tmp/zts_server_unit_tests/zts_root/coretech");
    assertFalse(file.exists());
}