}
@Test
public void testExceptionHandlerIsCalledDuringPhaseFailure() throws Exception
{
MessageProcessPhase failureMessageProcessPhase = createFailureMessageProcessPhase();
when(mockMuleContext.getExceptionListener()).thenReturn(mockExceptionListener);
MuleMessageProcessingManager manager = createManagerUsingPhasesInRegistry(Arrays.asList(failureMessageProcessPhase));
manager.processMessage(completeMessageProcessTemplateAndContext, completeMessageProcessTemplateAndContext);
verify(mockExceptionListener, times(1)).handleException(any(MuleException.class));
}