@Test
public void testFailure() {

    Task task = new Task();
    Input input = new Input();
    input.setUri("http://localhost:7009/failure");
    input.setMethod("GET");
    task.getInputData().put(HttpTask.REQUEST_PARAMETER_NAME, input);
    httpTask.start(workflow, task, workflowExecutor);
    assertEquals("Task output: " + task.getOutputData(), Task.Status.FAILED, task.getStatus());
    assertEquals(ERROR_RESPONSE, task.getReasonForIncompletion());
    task.setStatus(Status.SCHEDULED);
    task.getInputData().remove(HttpTask.REQUEST_PARAMETER_NAME);
    httpTask.start(workflow, task, workflowExecutor);
    assertEquals(Task.Status.FAILED, task.getStatus());
    assertEquals(HttpTask.MISSING_REQUEST, task.getReasonForIncompletion());
}