Examples of assertIsSatisfied()


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

        assertEquals("JSONObject doesn't contain 7 keys", 7, obj.entrySet().size());

        template.sendBody("direct:unmarshalInline", jsonString);

        mockJSON.assertIsSatisfied();
        mockXML.assertIsSatisfied();
    }
   
    @Test
    public void testNamespacesDroppedInlineWithOptions() throws Exception {
        InputStream inStream = getClass().getResourceAsStream("testMessage2-namespaces.xml");
View Full Code Here

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

        // a namespace prefix exists
        for (Object key : obj.getJSONObject("root").keySet()) {
            assertFalse("A key contains a colon", ((String) key).contains(":"));
        }

        mockJSON.assertIsSatisfied();
    }
   
    @Test
    public void testUnmarshalToXMLInlineOptions() throws Exception {
        InputStream inStream = getClass().getResourceAsStream("testMessage1.json");
View Full Code Here

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

        Object marshalled = template.requestBody("direct:unmarshalInlineOptions", in);
        Document document = context.getTypeConverter().convertTo(Document.class, marshalled);
        assertEquals("The XML document doesn't carry newRoot as the root name", "newRoot", document.getDocumentElement().getLocalName());
        assertEquals("The number of direct child elements of newRoot with tag d (expandable property) is not 3", 3, document.getDocumentElement().getElementsByTagName("d").getLength());
        assertEquals("The number of direct child elements of newRoot with tag e (expandable property) is not 3", 3, document.getDocumentElement().getElementsByTagName("e").getLength());
        mockXML.assertIsSatisfied();
    }

    @Test
    public void testJsonArraysToXml() throws Exception {
        MockEndpoint mockXML = getMockEndpoint("mock:xmlInlineOptionsArray");
View Full Code Here

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

        Object marshalled = template.requestBody("direct:unmarshalInlineOptionsArray", "[1, 2, 3, 4]");
        Document document = context.getTypeConverter().convertTo(Document.class, marshalled);
        assertEquals("There should be exactly 4 XML elements with tag 'el' (each array element)", 4, document.getDocumentElement().getElementsByTagName("el").getLength());
        assertEquals("The document root should be named 'ar' (the array root)", "ar", document.getDocumentElement().getLocalName());
        mockXML.assertIsSatisfied();
    }

    @Test
    public void testXmlArraysToJson() throws Exception {
        MockEndpoint mockJSON = getMockEndpoint("mock:jsonInlineOptionsArray");
View Full Code Here

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

        Object json = template.requestBody("direct:marshalInlineOptionsArray", "<ar><el>1</el><el>2</el><el>3</el><el>4</el></ar>");
        String jsonString = context.getTypeConverter().convertTo(String.class, json);
        JSONArray array = (JSONArray) JSONSerializer.toJSON(jsonString);
        assertTrue("Expected a JSON array with string elements: 1, 2, 3, 4", array.containsAll(Arrays.asList("1", "2", "3", "4")));
        mockJSON.assertIsSatisfied();
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
View Full Code Here

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

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

        verify(client, atLeastOnce()).reserve(anyInt());
        verify(client).delete(jobId);
    }
View Full Code Here

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

        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());
        verify(client, times(1)).close();
    }
View Full Code Here

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

        String text = tm.getText();
        assertNotNull(text);
       
        template.sendBody("direct:finish", text);
       
        mock.assertIsSatisfied();
        mc.close();

    }

    /**
 
View Full Code Here

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

        String marshalledAsString = context.getTypeConverter().convertTo(String.class, marshalled);
        assertEquals("{\"name\":\"Camel\"}", marshalledAsString);

        template.sendBody("direct:back", marshalled);

        mock.assertIsSatisfied();
    }

    @Test
    public void testMarshalAndUnmarshalMapWithPrettyPrint() throws Exception {
        Map<String, Object> in = new HashMap<String, Object>();
View Full Code Here

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

                         + "\n}";
        assertEquals(expected, marshalledAsString);

        template.sendBody("direct:backPretty", marshalled);

        mock.assertIsSatisfied();
    }

    @Test
    public void testMarshalAndUnmarshalPojo() throws Exception {
        TestPojo in = new TestPojo();
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.