// =====================================================================
// Test Expectations
// =====================================================================
DependencyTracker tracker =
new DependencyTrackerImpl();
Dependency dependency = tracker.extractDependency();
assertEquals(Cacheability.CACHEABLE, dependency.getCacheability());
assertEquals(Period.INDEFINITELY, dependency.getTimeToLive());
TestCaseAbstract.assertEquals(Freshness.FRESH, dependency.freshness(contextMock));
try {
dependency.revalidate(contextMock);
fail("Did not detect invalid call to revalidate");
} catch(IllegalStateException e) {
// Expected.
}
// Add the dependency from the empty tracker to another, it should
// be ignored by this tracker so it should behave just as if it only
// had a single dependency added.
tracker = new DependencyTrackerImpl();
tracker.addDependency(dependency);
tracker.addDependency(dependency1Mock);
dependency = tracker.extractDependency();
assertSame(dependency1Mock, dependency);
}