use of org.apache.camel.test.blueprint.Foo in project camel by apache.
the class CustomConverterTest method testCustomConverter.
@Test
public void testCustomConverter() throws Exception {
getMockEndpoint("mock:result").expectedMessageCount(1);
getMockEndpoint("mock:result").message(0).body().isInstanceOf(Foo.class);
template.sendBody("direct:start", "John,Doe");
assertMockEndpointsSatisfied();
Foo foo = getMockEndpoint("mock:result").getReceivedExchanges().get(0).getIn().getBody(Foo.class);
assertEquals("John", foo.getFirst());
assertEquals("Doe", foo.getLast());
}
use of org.apache.camel.test.blueprint.Foo in project camel by apache.
the class FooConverter method convertToFoo.
@Converter
public Foo convertToFoo(String data) {
String[] s = data.split(",");
Foo foo = new Foo();
foo.setFirst(s[0]);
foo.setLast(s[1]);
return foo;
}