@Test
public void testGetJobWithRetry() throws Exception {

  Configuration conf = new Configuration();
  conf.setInt(MRJobConfig.MR_CLIENT_JOB_MAX_RETRIES, 1);
  final Cluster mockCluster = mock(Cluster.class);
  final Job mockJob = Job.getInstance(conf);
  when(mockCluster.getJob(any(JobID.class))).thenReturn(
      null).thenReturn(mockJob);
  CLI cli = new CLI(conf);
  cli.cluster = mockCluster;
  Job job = cli.getJob(JobID.forName("job_1234654654_001"));
  Assert.assertTrue("job is null", job != null);
}