PhaseAfterValidationBeforeFlow messageProcessPhase = createPhaseAfterValidation();
when(completeMessageProcessTemplateAndContext.validateMessage()).thenReturn(true);
when(messageProcessPhase.compareTo(any(MessageProcessPhase.class))).thenCallRealMethod();
when(messageProcessPhase.supportsTemplate(any(MessageProcessTemplate.class))).thenCallRealMethod();
doCallRealMethod().when(messageProcessPhase).runPhase(any(MessageProcessTemplate.class), any(MessageProcessContext.class), any(PhaseResultNotifier.class));
MuleMessageProcessingManager manager = createManagerUsingPhasesInRegistry(Arrays.<MessageProcessPhase>asList(messageProcessPhase));
manager.processMessage(completeMessageProcessTemplateAndContext, completeMessageProcessTemplateAndContext);
verify(completeMessageProcessTemplateAndContext, times(0)).routeEvent(any(MuleEvent.class));
verify(completeMessageProcessTemplateAndContext, times(1)).validateMessage();
verify(completeMessageProcessTemplateAndContext, times(1)).messageProcessingEnded();
}