Package org.mule.modules.interceptor.processors

Examples of org.mule.modules.interceptor.processors.MessageProcessorBehavior


        validateMessageProcessorName();

        MockedMessageProcessorManager manager = getManager();
        MessageProcessorCall messageProcessorCall = new MessageProcessorCall(new MessageProcessorId(messageProcessorName, messageProcessorNamespace));
        messageProcessorCall.setAttributes(messageProcessorAttributes);
        manager.addBehavior(new MessageProcessorBehavior(messageProcessorCall, new CopyMessageTransformer((DefaultMuleMessage) message)));
    }
View Full Code Here


        validateMessageProcessorName();

        MockedMessageProcessorManager manager = getManager();
        MessageProcessorCall messageProcessorCall = new MessageProcessorCall(new MessageProcessorId(messageProcessorName, messageProcessorNamespace));
        messageProcessorCall.setAttributes(messageProcessorAttributes);
        manager.addBehavior(new MessageProcessorBehavior(messageProcessorCall, exception));
    }
View Full Code Here

        validateMessageProcessorName();

        MockedMessageProcessorManager manager = getManager();
        MessageProcessorCall messageProcessorCall = new MessageProcessorCall(new MessageProcessorId(messageProcessorName, messageProcessorNamespace));
        messageProcessorCall.setAttributes(messageProcessorAttributes);
        manager.addBehavior(new MessageProcessorBehavior(messageProcessorCall, new CopyMessageTransformer(new DefaultMuleMessage(NotDefinedPayload.getInstance(), muleContext))));
    }
View Full Code Here

        validateMessageProcessorName();

        MockedMessageProcessorManager manager = getManager();
        MessageProcessorCall messageProcessorCall = new MessageProcessorCall(new MessageProcessorId(messageProcessorName, messageProcessorNamespace));
        messageProcessorCall.setAttributes(messageProcessorAttributes);
        manager.addBehavior(new MessageProcessorBehavior(messageProcessorCall, transformer));
    }
View Full Code Here

        return messageProcessors;
    }

    private MessageProcessorBehavior returnValueBehavior()
    {
        return new MessageProcessorBehavior(MESSAGE_PROCESSOR_CALL, new CopyMessageTransformer((DefaultMuleMessage) muleMessage()));
    }
View Full Code Here

    @Test
    public void validThatResetRemovesAll()
    {
        MockedMessageProcessorManager manager = new MockedMessageProcessorManager();
        manager.addCall(createCall());
        manager.addBehavior(new MessageProcessorBehavior(createCall(), new CopyMessageTransformer((DefaultMuleMessage) muleMessage)));
        manager.addBeforeCallSpyAssertion(new SpyAssertion(null, null));
        manager.addAfterCallSpyAssertion(new SpyAssertion(null, null));

        manager.reset();
View Full Code Here

        MockedMessageProcessorManager manager = new MockedMessageProcessorManager();
        MessageProcessorCall bestMatchingCall = createCall();
        Map<String, Object> attributes = bestMatchingCall.getAttributes();
        attributes.put("attr2", "attrValue2");

        manager.addBehavior(new MessageProcessorBehavior(createCall(), new CopyMessageTransformer((DefaultMuleMessage) muleMessage)));
        manager.addBehavior(new MessageProcessorBehavior(bestMatchingCall, new CopyMessageTransformer((DefaultMuleMessage) muleMessage)));

        MessageProcessorBehavior matched = manager.getBetterMatchingBehavior(bestMatchingCall);

        assertEquals(bestMatchingCall, matched.getMessageProcessorCall());

    }
View Full Code Here

        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;
        }
View Full Code Here

TOP

Related Classes of org.mule.modules.interceptor.processors.MessageProcessorBehavior

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.