use of org.mule.runtime.core.privileged.transformer.CompositeConverter in project mule by mulesoft.
the class ShortestTransformationLengthTransformerFilterTestCase method filtersDifferentLengthWithBetterTrasnformerFist.
@Test
public void filtersDifferentLengthWithBetterTrasnformerFist() throws ResolverException {
Converter xmlToString = new MockConverterBuilder().named("xmlToString").from(XML_DATA_TYPE).to(STRING_DATA_TYPE).build();
Converter stringToJson = new MockConverterBuilder().named("stringToJson").from(STRING_DATA_TYPE).to(JSON_DATA_TYPE).build();
List<Converter> availableConverters = new ArrayList<Converter>();
availableConverters.add(xmlToString);
CompositeConverter compositeConverter = new CompositeConverter(xmlToString, stringToJson);
availableConverters.add(compositeConverter);
List<Converter> transformers = filter.filter(availableConverters, UNUSED_DATA_TYPE, UNUSED_DATA_TYPE);
assertEquals(1, transformers.size());
assertEquals(xmlToString, transformers.get(0));
}
Aggregations