command.pollForStatus = true;
command.pollingDelay = 10;
Mockito.when(jobs.get("j1")).thenReturn(jobGet);
Mockito.when(jobGet.execute()).thenReturn(
new Job().setStatus("started").setId("j1"),
new Job().setStatus("started").setId("j1"))
.thenThrow(GoogleJsonResponseException.class).thenReturn(
new Job().setStatus("pending").setDetailedStatus("pending-description"),
new Job().setStatus("pending").setDetailedStatus("pending-description"),
new Job().setStatus("success").setDetailedStatus("description-done"));
command.handleRequest(genomics);
String output = outContent.toString();
assertTrue(output, output.contains("Waiting for job: j1"));