}
public void test_cacheFill(String testName, boolean fill, boolean shouldBeFull) {
DBCollection endpointCacheCollection = getCacheCollection();
if (fill) {
for (long i = 0; i < (1 + SimpleFederatedCache.QUERY_FEDERATION_CACHE_CLEANSE_SIZE); ++i) {
SimpleFederatedCache fakeCacheElement = new SimpleFederatedCache();
fakeCacheElement.expiryDate = new Date(new Date().getTime() - 3600L*1000L); // (ie expired an hour ago)
fakeCacheElement._id = testName + "_" + i;
fakeCacheElement.cachedJson = new BasicDBObject();
endpointCacheCollection.save(fakeCacheElement.toDb());
}
_lastChecked = new Date(new Date().getTime() - 602L*1000L).getTime();
}
long count = endpointCacheCollection.count();
if (shouldBeFull) {