@Test
public void shouldCloneRunningJobOnUpgrade() throws InvalidProtocolBufferException {

  Store store1 =
      DataGenerator.createStore(
          "test-1", Store.StoreType.REDIS, ImmutableList.of(Triple.of("*", "*", false)));
  Store store2 =
      DataGenerator.createStore(
          "test-2", Store.StoreType.REDIS, ImmutableList.of(Triple.of("*", "*", false)));
  Source source = DataGenerator.createSource("servers:9092", "topic");
  Job existingJob =
      Job.builder()
          .setId("some-id")
          .setSource(source)
          .setStores(ImmutableMap.of(store1.getName(), store1))
          .build();
  existingJob.setExtId("extId");
  existingJob.setStatus(JobStatus.RUNNING);
  jobRepository.add(existingJob);
  List<JobTask> jobTasks =
      controllerWithConsolidation.makeJobUpdateTasks(
          ImmutableList.of(Pair.of(source, ImmutableSet.of(store1, store2))));
  assertThat(jobTasks, hasSize(1));
  assertThat(jobTasks, hasItem(isA(CreateJobTask.class)));
}