@Test
public void shouldGenerateStartedAndRecordSubmitToRunningTimeWhenContainerIsReady() throws Exception {

  when(time.nanoTime()).thenReturn(TimeUnit.SECONDS.toNanos(17));
  kdr.start(RUN_STATE, RunSpec.simple(POD_NAME, "busybox"));
  verify(stats).recordSubmission(POD_NAME);
  when(time.nanoTime()).thenReturn(TimeUnit.SECONDS.toNanos(18));
  when(time.nanoTime()).thenReturn(TimeUnit.SECONDS.toNanos(19));
  setRunning(createdPod, /* ready= */ false);
  receiveAndProcessEvent(Watcher.Action.MODIFIED, createdPod);
  verify(stateManager, never()).receive(Event.started(WORKFLOW_INSTANCE), -1);
  when(time.nanoTime()).thenReturn(TimeUnit.SECONDS.toNanos(4711));
  setRunning(createdPod, /* ready= */ true);
  receiveAndProcessEvent(Watcher.Action.MODIFIED, createdPod);
  verify(stateManager).receive(Event.started(WORKFLOW_INSTANCE), -1);
  verify(stats).recordRunning(POD_NAME);
}