private String fileName;
private String lineNumber;
public Object process(Object obj, Object[] args, MethodProxy proxy) throws Throwable
{
MuleEvent event = (MuleEvent) args[0];
MockedMessageProcessorManager manager = getMockedMessageProcessorManager(event.getMuleContext());
MunitMessageProcessorCall messageProcessorCall = buildCall(event);
runSpyAssertion(manager.getBetterMatchingBeforeSpyAssertion(messageProcessorCall), event);
registerCall(manager, messageProcessorCall);
MessageProcessorBehavior behavior = manager.getBetterMatchingBehavior(messageProcessorCall);
if (behavior != null)
{
if (behavior.getExceptionToThrow() != null)
{
runSpyAssertion(manager.getBetterMatchingAfterSpyAssertion(messageProcessorCall), event);
throw behavior.getExceptionToThrow();
}
if ( behavior.getMuleMessageTransformer() != null ){
event.setMessage(behavior.getMuleMessageTransformer().transform(event.getMessage()));
}
runSpyAssertion(manager.getBetterMatchingAfterSpyAssertion(messageProcessorCall), event);
return event;
}