{
@Override
public Object answer(InvocationOnMock invocationOnMock) throws Throwable
{
ResponseCompletionCallback callback = (ResponseCompletionCallback) invocationOnMock.getArguments()[1];
callback.responseSentWithFailure(mockException, (MuleEvent) invocationOnMock.getArguments()[0]);
return null;
}
}).when(mockTemplate).sendResponseToClient(any(MuleEvent.class), any(ResponseCompletionCallback.class));
phase.runPhase(mockTemplate, mockContext, mockNotifier);
verify(mockContext.getFlowConstruct().getExceptionListener()).handleException(any(Exception.class), any(MuleEvent.class));