@Test
void podIsTerminal() {

    when(kubeControllerConfiguration.getPodTerminalGracePeriodMs()).thenReturn(POD_TERMINAL_GRACE_PERIOD);
    V1Pod pod = new V1Pod()
            .metadata(new V1ObjectMeta().name(POD_NAME).creationTimestamp(new DateTime(clock.wallTime())))
            .status(new V1PodStatus().phase(RUNNING));
    TaskStatus taskStatus = TaskStatus.newBuilder()
            .withState(TaskState.Finished)
            .withTimestamp(clock.wallTime())
            .build();
    Task task = JobGenerator.oneBatchTask().toBuilder().withStatus(taskStatus).build();
    clock.advanceTime(Duration.ofMillis(POD_TERMINAL_GRACE_PERIOD + 1));
    Map<String, Task> currentTasks = Collections.singletonMap(POD_NAME, task);
    Assertions.assertThat(podGcController.isPodTerminal(pod, currentTasks)).isTrue();
}