ScheduledTask snapshotTask = makeTask("snapshotTask", ScheduleStatus.ASSIGNED);
ScheduledTask transactionTask = makeTask("transactionTask", ScheduleStatus.RUNNING);
Iterable<Entry> recoveredEntries = toEntries(
LogEntry.snapshot(new Snapshot().setTasks(ImmutableSet.of(snapshotTask))),
LogEntry.transaction(new Transaction(
ImmutableList.of(Op.saveTasks(new SaveTasks(ImmutableSet.of(transactionTask)))),
storageConstants.CURRENT_SCHEMA_VERSION)));
expect(log.open()).andReturn(logStream);
expect(logStream.readAll()).andReturn(recoveredEntries.iterator()).anyTimes();
// An empty saveTasks is an artifact of the fact that mutateTasks always writes a log operation
// even if nothing is changed.
streamMatcher.expectTransaction(Op.saveTasks(new SaveTasks(ImmutableSet.<ScheduledTask>of())))
.andReturn(nextPosition());
streamMatcher.expectTransaction(Op.saveFrameworkId(new SaveFrameworkId(FRAMEWORK_ID)))
.andReturn(nextPosition());
final CountDownLatch driverStarted = new CountDownLatch(1);