@Test
public void removeSchedulesForKeyspaceThatNoLongerExists() throws Exception {

  context.storage.addCluster(cluster);
  context.storage.addRepairSchedule(aRepairSchedule(cluster, "keyspace1", TWO_HOURS_AGO));
  context.storage.addRepairSchedule(aRepairSchedule(cluster, "keyspace2", TWO_HOURS_AGO));
  when(jmxProxy.getKeyspaces()).thenReturn(Lists.newArrayList("keyspace1"));
  clusterRepairAuto.scheduleRepairs(cluster);
  assertThat(context.storage.getAllRepairSchedules()).hasSize(1);
  assertThatClusterRepairSchedules(context.storage.getRepairSchedulesForCluster(cluster.getName()))
      .hasScheduleCount(1)
      .repairScheduleForKeyspace("keyspace1").hasCreationTimeCloseTo(TWO_HOURS_AGO);
}