private void assertBackupCount(int count) {
assertEquals(count, config.getDir().list().length);
}
private Snapshot makeSnapshot() {
Snapshot snapshot = new Snapshot();
snapshot.setTimestamp(clock.nowMillis());
snapshot.setHostAttributes(ImmutableSet.of(
new HostAttributes(
"hostA",
ImmutableSet.of(new Attribute("attr", ImmutableSet.of("value"))))));
snapshot.setJobs(ImmutableSet.of(
new StoredJob(
"jobManager",
new JobConfiguration().setKey(new JobKey("owner", "env", "jobA")))));
snapshot.setQuotaConfigurations(
ImmutableSet.of(new QuotaConfiguration("roleA", new ResourceAggregate(10, 1024, 1024))));
snapshot.setSchedulerMetadata(new SchedulerMetadata().setFrameworkId("frameworkId"));
snapshot.setTasks(ImmutableSet.of(new ScheduledTask()));
return snapshot;
}