Package org.apache.camel.component.mock

Examples of org.apache.camel.component.mock.MockEndpoint.expectedHeaderReceived()


        // at each destination, the routing slip should contain
        // the remaining destinations
        x.expectedHeaderReceived("aRoutingSlipHeader", "mock:y#mock:z");
        y.expectedHeaderReceived("aRoutingSlipHeader", "mock:z");
        z.expectedHeaderReceived("aRoutingSlipHeader", "");

        sendBody("direct:c", "aRoutingSlipHeader", "#");

        assertMockEndpointsSatisfied();
    }
View Full Code Here


    public void testInOutUsingMina() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Bye Claus");
        // we should preserve headers
        mock.expectedHeaderReceived("city", "Copenhagen");
        mock.setResultWaitTime(5000);

        Object out = template.requestBodyAndHeader("direct:in", "Claus", "city", "Copenhagen");

        assertMockEndpointsSatisifed();
View Full Code Here

    public void testNoErrors() throws Exception {
        outer.setName("Claus");
        inner.setName("James");

        MockEndpoint mock = getMockEndpoint("mock:end");
        mock.expectedHeaderReceived("name", "James");

        template.sendBody("direct:start", "Hello World");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

    public void testInnerError() throws Exception {
        outer.setName("Claus");
        inner.setName("Error");

        MockEndpoint mock = getMockEndpoint("mock:inner");
        mock.expectedHeaderReceived("name", "Claus");
        mock.expectedMessageCount(1);

        try {
            template.sendBody("direct:start", "Hello World");
            fail("Should have thrown a IllegalArgumentException");
View Full Code Here

    }

    public void testOnExceptionAlterMessageWithHeadersBeforeRedelivery() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Hello World123");
        mock.expectedHeaderReceived("foo", "123");

        template.sendBodyAndHeader("direct:start", "Hello World", "foo", "123");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

    public void testUnmarshal() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:unmarshal");
        mock.expectedMessageCount(1);
        mock.message(0).body().isInstanceOf(Message.class);

        mock.expectedHeaderReceived("hl7.msh.sendingApplication", "MYSERVER");
        mock.expectedHeaderReceived("hl7.msh.sendingFacility", "MYSENDERAPP");
        mock.expectedHeaderReceived("hl7.msh.receivingApplication", "MYCLIENT");
        mock.expectedHeaderReceived("hl7.msh.receivingFacility", "MYCLIENTAPP");
        mock.expectedHeaderReceived("hl7.msh.timestamp", "200612211200");
        mock.expectedHeaderReceived("hl7.msh.security", null);
View Full Code Here

        MockEndpoint mock = getMockEndpoint("mock:unmarshal");
        mock.expectedMessageCount(1);
        mock.message(0).body().isInstanceOf(Message.class);

        mock.expectedHeaderReceived("hl7.msh.sendingApplication", "MYSERVER");
        mock.expectedHeaderReceived("hl7.msh.sendingFacility", "MYSENDERAPP");
        mock.expectedHeaderReceived("hl7.msh.receivingApplication", "MYCLIENT");
        mock.expectedHeaderReceived("hl7.msh.receivingFacility", "MYCLIENTAPP");
        mock.expectedHeaderReceived("hl7.msh.timestamp", "200612211200");
        mock.expectedHeaderReceived("hl7.msh.security", null);
        mock.expectedHeaderReceived("hl7.msh.messageType", "QRY");
View Full Code Here

        mock.expectedMessageCount(1);
        mock.message(0).body().isInstanceOf(Message.class);

        mock.expectedHeaderReceived("hl7.msh.sendingApplication", "MYSERVER");
        mock.expectedHeaderReceived("hl7.msh.sendingFacility", "MYSENDERAPP");
        mock.expectedHeaderReceived("hl7.msh.receivingApplication", "MYCLIENT");
        mock.expectedHeaderReceived("hl7.msh.receivingFacility", "MYCLIENTAPP");
        mock.expectedHeaderReceived("hl7.msh.timestamp", "200612211200");
        mock.expectedHeaderReceived("hl7.msh.security", null);
        mock.expectedHeaderReceived("hl7.msh.messageType", "QRY");
        mock.expectedHeaderReceived("hl7.msh.triggerEvent", "A19");
View Full Code Here

        mock.message(0).body().isInstanceOf(Message.class);

        mock.expectedHeaderReceived("hl7.msh.sendingApplication", "MYSERVER");
        mock.expectedHeaderReceived("hl7.msh.sendingFacility", "MYSENDERAPP");
        mock.expectedHeaderReceived("hl7.msh.receivingApplication", "MYCLIENT");
        mock.expectedHeaderReceived("hl7.msh.receivingFacility", "MYCLIENTAPP");
        mock.expectedHeaderReceived("hl7.msh.timestamp", "200612211200");
        mock.expectedHeaderReceived("hl7.msh.security", null);
        mock.expectedHeaderReceived("hl7.msh.messageType", "QRY");
        mock.expectedHeaderReceived("hl7.msh.triggerEvent", "A19");
        mock.expectedHeaderReceived("hl7.msh.messageType", "QRY");
View Full Code Here

        mock.expectedHeaderReceived("hl7.msh.sendingApplication", "MYSERVER");
        mock.expectedHeaderReceived("hl7.msh.sendingFacility", "MYSENDERAPP");
        mock.expectedHeaderReceived("hl7.msh.receivingApplication", "MYCLIENT");
        mock.expectedHeaderReceived("hl7.msh.receivingFacility", "MYCLIENTAPP");
        mock.expectedHeaderReceived("hl7.msh.timestamp", "200612211200");
        mock.expectedHeaderReceived("hl7.msh.security", null);
        mock.expectedHeaderReceived("hl7.msh.messageType", "QRY");
        mock.expectedHeaderReceived("hl7.msh.triggerEvent", "A19");
        mock.expectedHeaderReceived("hl7.msh.messageType", "QRY");
        mock.expectedHeaderReceived("hl7.msh.triggerEvent", "A19");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.