use of org.apache.camel.cdi.pojo.TypeConverterInput in project camel by apache.
the class InjectedTypeConverterTest method convertWithTypeConverter.
@Test
public void convertWithTypeConverter(TypeConverter converter) throws NoTypeConversionAvailableException {
TypeConverterInput input = new TypeConverterInput();
input.setProperty("property value is [{{property2}}]");
TypeConverterOutput output = converter.mandatoryConvertTo(TypeConverterOutput.class, input);
assertThat(output.getProperty(), is(equalTo("property value is [value 2]")));
}
use of org.apache.camel.cdi.pojo.TypeConverterInput in project camel by apache.
the class InjectedTypeConverterTest method sendMessageToInbound.
@Test
public void sendMessageToInbound(@Uri("direct:inbound") ProducerTemplate inbound, @Uri("mock:outbound") MockEndpoint outbound) throws InterruptedException {
outbound.expectedMessageCount(1);
TypeConverterInput input = new TypeConverterInput();
input.setProperty("property value is [{{property1}}]");
inbound.sendBody(input);
assertIsSatisfied(2L, TimeUnit.SECONDS, outbound);
assertThat(outbound.getExchanges().get(0).getIn().getBody(TypeConverterOutput.class).getProperty(), is(equalTo("property value is [value 1]")));
}
Aggregations