@Test
public void addSchedulesForNewKeyspace() throws Exception {

  context.storage.addCluster(cluster);
  context.storage.addRepairSchedule(aRepairSchedule(cluster, "keyspace1", TWO_HOURS_AGO));
  when(jmxProxy.getKeyspaces()).thenReturn(Lists.newArrayList("keyspace1", "keyspace2"));
  when(jmxProxy.getTablesForKeyspace("keyspace1")).thenReturn(
          Sets.newHashSet(Table.builder().withName("table1").withCompactionStrategy(STCS).build()));
  when(jmxProxy.getTablesForKeyspace("keyspace2")).thenReturn(
          Sets.newHashSet(Table.builder().withName("table2").withCompactionStrategy(STCS).build()));
  clusterRepairAuto.scheduleRepairs(cluster);
  assertThat(context.storage.getAllRepairSchedules()).hasSize(2);
  assertThatClusterRepairSchedules(context.storage.getRepairSchedulesForCluster(cluster.getName()))
      .hasScheduleCount(2)
      .repairScheduleForKeyspace("keyspace1").hasCreationTime(TWO_HOURS_AGO)
      .andThen()
      .repairScheduleForKeyspace("keyspace2").hasCreationTimeCloseTo(DateTime.now());
}