Package org.apache.camel.component.mock

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


public class JmsBeanMethodHeaderTest extends ContextTestSupport {

    public void testPlainHeader() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Hello World");
        mock.expectedHeaderReceived("foo", "yes");

        template.sendBodyAndHeader("direct:in", "Hello World", "foo", "yes");

        mock.assertIsSatisfied();
    }
View Full Code Here


    }

    public void testUnderscoreHeader() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Hello World");
        mock.expectedHeaderReceived("foo_bar", "yes");

        template.sendBodyAndHeader("direct:in", "Hello World", "foo_bar", "yes");

        mock.assertIsSatisfied();
    }
View Full Code Here

    public void testPropogateHeadersTest() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);
        mock.expectedBodiesReceived("<transformed subject=\"Hey\"><mail><subject>Hey</subject>"
            + "<body>Hello world!</body></mail></transformed>");
        mock.expectedHeaderReceived("foo", "bar");

        template.sendBodyAndHeader("direct:one",
            "<mail><subject>Hey</subject><body>Hello world!</body></mail>", "foo", "bar");

        assertMockEndpointsSatisfied();
View Full Code Here

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

        template.sendBodyAndHeader("direct:two",
            "<person name='James' city='London'/>", "foo", "bar");

        assertMockEndpointsSatisfied();
View Full Code Here

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

        template.sendBodyAndHeader("direct:three",
            "<person name='James' city='London'/>", "foo", "bar");

        assertMockEndpointsSatisfied();
View Full Code Here

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

    public void testSendX() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("<html><body>foo</body></html>");
        mock.expectedHeaderReceived("x", "foo");

        template.sendBody(serverUri + "?x=foo", null);

        assertMockEndpointsSatisfied();
    }
View Full Code Here

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

    public void testHttpGetWithParamsViaURI() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedHeaderReceived("one", "einz");
        mock.expectedHeaderReceived("two", "twei");
        mock.expectedHeaderReceived(HttpMethods.HTTP_METHOD, "GET");

        template.sendBody(serverUri + "?one=einz&two=twei", null);
View Full Code Here

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

    public void testHttpGetWithParamsViaURI() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedHeaderReceived("one", "einz");
        mock.expectedHeaderReceived("two", "twei");
        mock.expectedHeaderReceived(HttpMethods.HTTP_METHOD, "GET");

        template.sendBody(serverUri + "?one=einz&two=twei", null);

        assertMockEndpointsSatisfied();
View Full Code Here

    public void testHttpGetWithParamsViaURI() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedHeaderReceived("one", "einz");
        mock.expectedHeaderReceived("two", "twei");
        mock.expectedHeaderReceived(HttpMethods.HTTP_METHOD, "GET");

        template.sendBody(serverUri + "?one=einz&two=twei", null);

        assertMockEndpointsSatisfied();
    }
View Full Code Here

        assertMockEndpointsSatisfied();
    }

    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");
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.