@Test
    public void testUpdateTaskWithCallbackAfterSeconds() {
        String workflowId = "test-workflow-id";
        WorkflowModel workflow = new WorkflowModel();
        workflow.setWorkflowId(workflowId);
        workflow.setStatus(WorkflowModel.Status.RUNNING);
        workflow.setWorkflowDefinition(new WorkflowDef());

        TaskModel simpleTask = new TaskModel();
        simpleTask.setTaskType(TaskType.SIMPLE.name());
        simpleTask.setReferenceTaskName("simpleTask");
        simpleTask.setWorkflowInstanceId(workflowId);
        simpleTask.setScheduledTime(System.currentTimeMillis());
        simpleTask.setCallbackAfterSeconds(0);
        simpleTask.setTaskId("simple-task-id");
        simpleTask.setStatus(TaskModel.Status.IN_PROGRESS);

        workflow.getTasks().add(simpleTask);
        when(executionDAOFacade.getWorkflowModel(workflowId, false)).thenReturn(workflow);
        when(executionDAOFacade.getTaskModel(simpleTask.getTaskId())).thenReturn(simpleTask);

        TaskResult taskResult = new TaskResult();
        taskResult.setWorkflowInstanceId(workflowId);
        taskResult.setTaskId(simpleTask.getTaskId());
        taskResult.setWorkerId("test-worker-id");
        taskResult.log("not ready yet");
        taskResult.setCallbackAfterSeconds(300);
        taskResult.setStatus(TaskResult.Status.IN_PROGRESS);

        workflowExecutor.updateTask(taskResult);
        verify(queueDAO, times(1)).postpone(anyString(), anyString(), anyInt(), anyLong());
        ArgumentCaptor<TaskModel> argumentCaptor = ArgumentCaptor.forClass(TaskModel.class);
        verify(executionDAOFacade, times(1)).updateTask(argumentCaptor.capture());
        assertEquals(TaskModel.Status.SCHEDULED, argumentCaptor.getAllValues().get(0).getStatus());
        assertEquals(
                taskResult.getCallbackAfterSeconds(),
                argumentCaptor.getAllValues().get(0).getCallbackAfterSeconds());
        assertEquals(taskResult.getWorkerId(), argumentCaptor.getAllValues().get(0).getWorkerId());
    }
Simulate Queue push failures and assert that scheduleTask doesn't throw an exception.
core/src/test/java/com/netflix/conductor/core/execution/TestWorkflowExecutor.java