use of org.apache.camel.Message in project camel by apache.
the class StreamedSplitTest method testCamel.
@Test
public void testCamel() throws Exception {
results.expectedMessageCount(4);
results.assertIsSatisfied();
int counter = 0;
List<Exchange> list = results.getReceivedExchanges();
for (Exchange exchange : list) {
Message in = exchange.getIn();
Map<?, ?> body = in.getBody(Map.class);
assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body);
assertEquals("NAME", expectedItemDesc[counter], body.get("NAME"));
LOG.info("Result: " + counter + " = " + body);
counter++;
}
}
use of org.apache.camel.Message in project camel by apache.
the class FixedLengthAllowLongTest method testCamel.
@Test
public void testCamel() throws Exception {
results.expectedMessageCount(4);
results.assertIsSatisfied();
int counter = 0;
List<Exchange> list = results.getReceivedExchanges();
for (Exchange exchange : list) {
Message in = exchange.getIn();
assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter);
Map<?, ?> body = in.getBody(Map.class);
assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body);
assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME"));
LOG.info("Result: " + counter + " = " + body);
counter++;
}
}
use of org.apache.camel.Message in project camel by apache.
the class FixedLengthAllowShortAndLongTest method testFlatpack.
@Test
public void testFlatpack() throws Exception {
results.expectedMessageCount(4);
results.assertIsSatisfied();
int counter = 0;
List<Exchange> list = results.getReceivedExchanges();
for (Exchange exchange : list) {
Message in = exchange.getIn();
assertEquals("counter", in.getHeader("camelFlatpackCounter"), counter);
Map<?, ?> body = in.getBody(Map.class);
assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body);
assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME"));
LOG.info("Result: " + counter + " = " + body);
counter++;
}
}
use of org.apache.camel.Message in project camel by apache.
the class FixedLengthWithUnmarshalTest method testCamel.
@Test
public void testCamel() throws Exception {
results.expectedMessageCount(4);
results.assertIsSatisfied();
int counter = 0;
List<Exchange> list = results.getReceivedExchanges();
for (Exchange exchange : list) {
Message in = exchange.getIn();
Map<?, ?> body = in.getBody(Map.class);
assertNotNull("Should have found body as a Map but was: " + ObjectHelper.className(in.getBody()), body);
assertEquals("FIRSTNAME", expectedFirstName[counter], body.get("FIRSTNAME"));
LOG.info("Result: " + counter + " = " + body);
counter++;
}
}
use of org.apache.camel.Message in project camel by apache.
the class FreemarkerSetHeaderTest method assertRespondsWith.
protected void assertRespondsWith(final String value, String expectedBody) throws InvalidPayloadException, InterruptedException {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(1);
//mock.expectedHeaderReceived("fruit", value);
mock.expectedBodiesReceived(expectedBody);
template.request("direct:start", new Processor() {
public void process(Exchange exchange) throws Exception {
Message in = exchange.getIn();
in.setBody(value);
}
});
mock.assertIsSatisfied();
}
Aggregations