public class MetricCalculatorTest extends EasyMockTest {
@Test
public void runTest() {
FakeClock clock = new FakeClock();
StatsProvider statsProvider = createMock(StatsProvider.class);
StatsProvider untracked = createMock(StatsProvider.class);
MetricCalculatorSettings settings = new MetricCalculatorSettings(10000);
StorageTestUtil storageUtil = new StorageTestUtil(this);
MetricCalculator calculator = new MetricCalculator(
storageUtil.storage,
clock,
settings,
statsProvider);
expect(statsProvider.untracked()).andReturn(untracked).anyTimes();
Capture<String> names = new Capture<>(CaptureType.ALL);
expect(untracked.makeGauge(EasyMock.capture(names), EasyMock.<Supplier<Number>>anyObject()))
.andReturn(EasyMock.<Stat<Number>>anyObject())
.anyTimes();
IScheduledTask task1 = makeTask(ImmutableMap.of(clock.nowMillis() - 1000, PENDING), 0);
IScheduledTask task2 = makeTask(ImmutableMap.of(clock.nowMillis() - 2000, PENDING), 1);