use of org.globalbioticinteractions.cache.Cache in project eol-globi-data by jhpoelen.
the class DatasetWithCacheTest method datasetLastAccessedAt.
private DatasetWithCache datasetLastAccessedAt(String lastAccessed) {
Cache cache = Mockito.mock(Cache.class);
CachedURI cacheURI = Mockito.mock(CachedURI.class);
when(cacheURI.getAccessedAt()).thenReturn(lastAccessed);
when(cache.asMeta(any(URI.class))).thenReturn(cacheURI);
DatasetImpl datasetUncached = new DatasetImpl("some/namespace", URI.create("some:bla"));
return new DatasetWithCache(datasetUncached, cache);
}
use of org.globalbioticinteractions.cache.Cache in project eol-globi-data by jhpoelen.
the class DatasetFinderWithCacheTest method datasetCached.
private Dataset datasetCached() throws IOException, URISyntaxException {
Dataset dataset = Mockito.mock(Dataset.class);
when(dataset.getNamespace()).thenReturn("some/namespace");
when(dataset.getArchiveURI()).thenReturn(getClass().getResource("archive.zip").toURI());
Cache cache = CacheUtil.cacheFor("some/namespace", cachePath);
return new DatasetWithCache(dataset, cache);
}
Aggregations