Examples of expectedBodiesReceived()


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

        assertNotNull(mc);
        final String expectedBody = "Hello World!";
        MockEndpoint mock = getMockEndpoint("mock:result");

        mock.expectedMessageCount(1);
        mock.expectedBodiesReceived(expectedBody);

        template.sendBody("direct:start", expectedBody);
        Message message = mc.receive(5000);
        assertNotNull(message);
        assertTrue(message instanceof TextMessage);
View Full Code Here

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

        String detachedPayload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + //
                "<ns:root xmlns:ns=\"http://test\"><a ID=\"myID\"><b>bValue</b></a></ns:root>";
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);
        MockEndpoint mockVerified = getMockEndpoint("mock:verified");
        mockVerified.expectedBodiesReceived(detachedPayload);
        sendBody("direct:detached", detachedPayload);
        assertMockEndpointsSatisfied();
        Map<String, String> namespaceMap = new TreeMap<String, String>();
        namespaceMap.put("ns", "http://test");
        namespaceMap.put("ds", XMLSignature.XMLNS);
View Full Code Here

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

                .thenReturn(jobMock)
                .thenReturn(null);

        MockEndpoint result = getMockEndpoint("mock:result");
        result.expectedMessageCount(1);
        result.expectedBodiesReceived(testMessage);
        result.expectedHeaderReceived(Headers.JOB_ID, jobId);
        result.message(0).header(Headers.JOB_ID).isEqualTo(jobId);
        result.assertIsSatisfied(100);

        verify(client, atLeast(1)).reserve(0);
View Full Code Here

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

        String detachedPayload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + //
                "<ns:root xmlns:ns=\"http://test\"><test ID=\"myID\"><b>bValue</b><ts:B xmlns:ts=\"http://testB\"><C ID=\"cID\"><D>dvalue</D></C></ts:B></test></ns:root>";
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);
        MockEndpoint mockVerified = getMockEndpoint("mock:verified");
        mockVerified.expectedBodiesReceived(detachedPayload);
        Map<String, Object> headers = new TreeMap<String, Object>();
        headers.put(XmlSignatureConstants.HEADER_SCHEMA_RESOURCE_URI, (Object) "org/apache/camel/component/xmlsecurity/TestComplex.xsd");
        Map<String, String> namespaceMap = new TreeMap<String, String>();
        namespaceMap.put("ns", "http://test");
        namespaceMap.put("ns1", "http://testB");
View Full Code Here

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

                .thenThrow(new BeanstalkException("test"))
                .thenReturn(jobMock);

        MockEndpoint result = getMockEndpoint("mock:result");
        result.expectedMessageCount(1);
        result.expectedBodiesReceived(testMessage);
        result.expectedHeaderReceived(Headers.JOB_ID, jobId);
        result.message(0).header(Headers.JOB_ID).isEqualTo(jobId);
        result.assertIsSatisfied(100);

        verify(client, atLeast(1)).reserve(anyInt());
View Full Code Here

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

            String verifierEndpointUri, String directStart) throws InterruptedException, UnsupportedEncodingException {
        byte[] inputPayload = getPayloadForEncoding(inputEncoding);
        byte[] expectedPayload = getPayloadForEncoding(outputEncoding);

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived(expectedPayload);

        MockEndpoint mockSigned = getMockEndpoint("mock:signed");
        mock.expectedMessageCount(1);

        XmlSignerEndpoint endpointSigner = (XmlSignerEndpoint) context().getEndpoint(signerEndpointUri);
View Full Code Here

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

        return setupMock(payload);
    }

    private MockEndpoint setupMock(String payload) {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived(payload);
        return mock;
    }

    public Exchange doTestSignatureRoute(RouteBuilder builder) throws Exception {
        return doSignatureRouteTest(builder, null, Collections.<String, Object> emptyMap());
View Full Code Here

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

        return setupMock(payload);
    }

    private MockEndpoint setupMock(String payload) {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived(payload);
        return mock;
    }

    @Before
    public void setUp() throws Exception {
View Full Code Here

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

        return setupMock(payload);
    }

    private MockEndpoint setupMock(String payload) {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived(payload);
        return mock;
    }

    public Exchange doTestSignatureRoute(RouteBuilder builder) throws Exception {
        return doSignatureRouteTest(builder, null, Collections.<String, Object> emptyMap());
View Full Code Here

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

    }

    @Test
    public void testWithExtension() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("<transformed extension-function-render=\"arg1[test]\"/>");

        template.sendBody("direct:start", "<body>test</body>");

        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.