Examples of expectedBodiesReceived()


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

    protected String messageType = getClass().getName();

    public void testForwardingAMessageAcrossJMSKeepingCustomJMSHeaders() throws Exception {
        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);

        resultEndpoint.expectedBodiesReceived(expectedBody);
        AssertionClause firstMessageExpectations = resultEndpoint.message(0);
        firstMessageExpectations.header("cheese").isEqualTo(123);
        firstMessageExpectations.header("JMSReplyTo").isEqualTo(replyQueue);
        firstMessageExpectations.header("JMSCorrelationID").isEqualTo(correlationID);
        firstMessageExpectations.header("JMSType").isEqualTo(messageType);
View Full Code Here

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

        Integer started = (Integer) mbeanServer.getAttribute(on, "StartedRoutes");
        assertEquals(2, started.intValue());

        // invoke operations
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Hello World");
        mbeanServer.invoke(on, "sendBody", new Object[]{"direct:start", "Hello World"}, new String[]{"java.lang.String", "java.lang.Object"});
        assertMockEndpointsSatisfied();

        resetMocks();
        mock.expectedBodiesReceived("Hello World");
View Full Code Here

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

        mock.expectedBodiesReceived("Hello World");
        mbeanServer.invoke(on, "sendBody", new Object[]{"direct:start", "Hello World"}, new String[]{"java.lang.String", "java.lang.Object"});
        assertMockEndpointsSatisfied();

        resetMocks();
        mock.expectedBodiesReceived("Hello World");
        mbeanServer.invoke(on, "sendStringBody", new Object[]{"direct:start", "Hello World"}, new String[]{"java.lang.String", "java.lang.String"});
        assertMockEndpointsSatisfied();

        Object reply = mbeanServer.invoke(on, "requestBody", new Object[]{"direct:foo", "Hello World"}, new String[]{"java.lang.String", "java.lang.Object"});
        assertEquals("Bye World", reply);
View Full Code Here

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

        reply = mbeanServer.invoke(on, "requestStringBody", new Object[]{"direct:foo", "Hello World"}, new String[]{"java.lang.String", "java.lang.String"});
        assertEquals("Bye World", reply);

        resetMocks();
        mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Hello World");
        mock.expectedHeaderReceived("foo", 123);
        Map<String, Object> headers = new HashMap<String, Object>();
        headers.put("foo", 123);
        mbeanServer.invoke(on, "sendBodyAndHeaders", new Object[]{"direct:start", "Hello World", headers}, new String[]{"java.lang.String", "java.lang.Object", "java.util.Map"});
        assertMockEndpointsSatisfied();
View Full Code Here

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

        mbeanServer.invoke(on, "sendBodyAndHeaders", new Object[]{"direct:start", "Hello World", headers}, new String[]{"java.lang.String", "java.lang.Object", "java.util.Map"});
        assertMockEndpointsSatisfied();

        resetMocks();
        mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Hello World");
        mock.expectedHeaderReceived("foo", 123);
        reply = mbeanServer.invoke(on, "requestBodyAndHeaders", new Object[]{"direct:start", "Hello World", headers}, new String[]{"java.lang.String", "java.lang.Object", "java.util.Map"});
        assertEquals("Hello World", reply);
        assertMockEndpointsSatisfied();
View Full Code Here

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

        Mailbox mailbox = Mailbox.get("bill@localhost");
        assertEquals(3, mailbox.size());

        // This one has search term *not* set
        MockEndpoint mockAsc = getMockEndpoint("mock:resultAscending");
        mockAsc.expectedBodiesReceived("Earlier date", "Later date");

        // This one has search term set
        MockEndpoint mockDesc = getMockEndpoint("mock:resultDescending");
        mockDesc.expectedBodiesReceived("Even later date", "Later date", "Earlier date");

View Full Code Here

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

        MockEndpoint mockAsc = getMockEndpoint("mock:resultAscending");
        mockAsc.expectedBodiesReceived("Earlier date", "Later date");

        // This one has search term set
        MockEndpoint mockDesc = getMockEndpoint("mock:resultDescending");
        mockDesc.expectedBodiesReceived("Even later date", "Later date", "Earlier date");

        // This one has search term set
        MockEndpoint mockDescImap = getMockEndpoint("mock:resultDescendingImap");
        mockDescImap.expectedBodiesReceived("Even later date", "Later date", "Earlier date");
View Full Code Here

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

        MockEndpoint mockDesc = getMockEndpoint("mock:resultDescending");
        mockDesc.expectedBodiesReceived("Even later date", "Later date", "Earlier date");

        // This one has search term set
        MockEndpoint mockDescImap = getMockEndpoint("mock:resultDescendingImap");
        mockDescImap.expectedBodiesReceived("Even later date", "Later date", "Earlier date");

        assertMockEndpointsSatisfied();
    }

    private void prepareMailbox() throws Exception {
View Full Code Here

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

    @Test
    public void testPlainString() throws Exception {
        // START SNIPPET: e1
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Bye World");

        // send plain hello world as String
        Object out = template.requestBody("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec", "Hello World", String.class);

        assertMockEndpointsSatisfied();
View Full Code Here

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

        MockJiraRestClient client = (MockJiraRestClient) factory.getClient();
        MockSearchRestClient restClient = (MockSearchRestClient) client.getSearchClient();
        BasicIssue issue1 = restClient.addIssue();

        mockResultEndpoint.expectedBodiesReceived(issue1);
       
        mockResultEndpoint.assertIsSatisfied();
    }

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.