Package org.apache.camel.component.mock

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


    }

    public void testHttpGetWithParamsViaHeader() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedHeaderReceived("one", "uno");
        mock.expectedHeaderReceived("two", "dos");
        mock.expectedHeaderReceived(HttpMethods.HTTP_METHOD, "GET");

        template.sendBodyAndHeader(serverUri, null, HttpProducer.QUERY, "one=uno&two=dos");

        assertMockEndpointsSatisfied();
View Full Code Here


    public void testHttpGetWithParamsViaHeader() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedHeaderReceived("one", "uno");
        mock.expectedHeaderReceived("two", "dos");
        mock.expectedHeaderReceived(HttpMethods.HTTP_METHOD, "GET");

        template.sendBodyAndHeader(serverUri, null, HttpProducer.QUERY, "one=uno&two=dos");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

    }

    public void testHttpPost() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Hello World");
        mock.expectedHeaderReceived(HttpMethods.HTTP_METHOD, "POST");

        template.sendBody(serverUri, "Hello World");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

    private MyParamsProcessor processor = new MyParamsProcessor();

    public void testHttpGetWithParamsViaURI() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Bye World");
        mock.expectedHeaderReceived("one", "einz");
        mock.expectedHeaderReceived("two", "twei");

        template.sendBody(serverUri + "?one=uno&two=dos", "Hello World");

        assertMockEndpointsSatisfied();
View Full Code Here

    public void testHttpGetWithParamsViaURI() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Bye World");
        mock.expectedHeaderReceived("one", "einz");
        mock.expectedHeaderReceived("two", "twei");

        template.sendBody(serverUri + "?one=uno&two=dos", "Hello World");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

    }

    public void testHttpGetWithParamsViaHeader() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Bye World");
        mock.expectedHeaderReceived("one", "einz");
        mock.expectedHeaderReceived("two", "twei");

        template.sendBodyAndHeader(serverUri, "Hello World", HttpProducer.QUERY, "one=uno&two=dos");

        assertMockEndpointsSatisfied();
View Full Code Here

    public void testHttpGetWithParamsViaHeader() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Bye World");
        mock.expectedHeaderReceived("one", "einz");
        mock.expectedHeaderReceived("two", "twei");

        template.sendBodyAndHeader(serverUri, "Hello World", HttpProducer.QUERY, "one=uno&two=dos");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

    private String serverUri = "http://localhost:5432/myservice";

    public void testSendOne() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:one");

        mock.expectedHeaderReceived("one", "true");

        template.sendBody(serverUri + "?one=true", null);

        assertMockEndpointsSatisfied();
    }
View Full Code Here

    }

    public void testSendOther() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:other");

        mock.expectedHeaderReceived("two", "true");

        template.sendBody(serverUri + "?two=true", null);

        assertMockEndpointsSatisfied();
    }
View Full Code Here

    private JdbcTemplate jdbcTemplate;

    public void testPreserveHeaders() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);
        mock.expectedHeaderReceived("foo", "bar");

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

        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.