Examples of expectedHeaderReceived()


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

        headers.put(headerName,headerValue);
        headers.put( DroolsComponent.DROOLS_LOOKUP,"ksession1");
       
        // set mock expectations
        mockResult.expectedMessageCount(1);
        mockResult.expectedHeaderReceived(headerName,headerValue);
       
        template.requestBodyAndHeaders("direct:test-no-session-withHeader",
                cmd,headers);
       
        ExecutionResults response = mockResult.getReceivedExchanges().get(0).getIn().getBody(ExecutionResults.class);
View Full Code Here

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

        Map<String,Object> headers= new HashMap<String, Object>();
        headers.put(headerName,headerValue);
       
        // set mock expectations
        mockResult.expectedMessageCount(1);
        mockResult.expectedHeaderReceived(headerName,headerValue);
       
        //do test
        template.requestBodyAndHeaders("direct:test-with-session-withHeader",
                batchExecutionCommand,headers);
       
View Full Code Here

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

    // END SNIPPET e2

    public void testCustomPolicy() throws Exception {
        MockEndpoint mock = getMockEndpoint(ERROR_QUEUE);
        mock.expectedMessageCount(1);
        mock.expectedHeaderReceived(MESSAGE_INFO, "Damm my policy exception");

        try {
            template.sendBody("direct:a", "Hello Camel");
        } catch (Exception e) {
            // expected
View Full Code Here

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

    }
   
    public void testSplitterWithStreaming() throws Exception {
        MockEndpoint resultEndpoint = getMockEndpoint("mock:result");
        resultEndpoint.expectedMessageCount(5);
        resultEndpoint.expectedHeaderReceived("foo", "bar");

        template.request("direct:streaming", new Processor() {
            public void process(Exchange exchange) {
                Message in = exchange.getIn();
                in.setBody("James,Guillaume,Hiram,Rob,Roman");
View Full Code Here

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

    }
   
    public void testSplitterWithException() throws Exception {
        MockEndpoint resultEndpoint = getMockEndpoint("mock:result");
        resultEndpoint.expectedMessageCount(4);
        resultEndpoint.expectedHeaderReceived("foo", "bar");
       
        MockEndpoint failedEndpoint = getMockEndpoint("mock:failed");
        failedEndpoint.expectedMessageCount(1);
        failedEndpoint.expectedHeaderReceived("foo", "bar");
       
View Full Code Here

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

        resultEndpoint.expectedMessageCount(4);
        resultEndpoint.expectedHeaderReceived("foo", "bar");
       
        MockEndpoint failedEndpoint = getMockEndpoint("mock:failed");
        failedEndpoint.expectedMessageCount(1);
        failedEndpoint.expectedHeaderReceived("foo", "bar");
       
        Exchange result = template.request("direct:exception", new Processor() {
            public void process(Exchange exchange) {
                Message in = exchange.getIn();
                in.setBody("James,Guillaume,Hiram,Rob,Exception");
View Full Code Here

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

public class DeadLetterChannelHandledExampleTest extends ContextTestSupport {

    public void testOrderOK() throws Exception {
        MockEndpoint result = getMockEndpoint("mock:result");
        result.expectedBodiesReceived("Order OK");
        result.expectedHeaderReceived("orderid", "123");

        MockEndpoint error = getMockEndpoint("mock:error");
        error.expectedMessageCount(0);

        Object out = template.requestBodyAndHeader("direct:start", "Order: MacBook Pro", "customerid", "444");
View Full Code Here

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

    }

    public void testOrderERROR() throws Exception {
        MockEndpoint error = getMockEndpoint("mock:error");
        error.expectedBodiesReceived("Order ERROR");
        error.expectedHeaderReceived("orderid", "failed");

        MockEndpoint result = getMockEndpoint("mock:result");
        result.expectedMessageCount(0);

        Object out = template.requestBodyAndHeader("direct:start", "Order: kaboom", "customerid", "555");
View Full Code Here

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

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

        sendBody("direct:a", ROUTING_SLIP_HEADER, ",");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

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:b", "aRoutingSlipHeader", ",");

        assertMockEndpointsSatisfied();
    }
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.