I figured this out right after posting. I needed to add
src/main/resources as a source folder in Eclipse (so it would pick up
META-INF/services/org/apache/camel/TypeConverter).

On 2011-07-05 1:43 PM, Brendan Long wrote:
> I'm trying to do some unit tests on my type converters in what seems
> like an obvious way:
>
> public class MyObjectTest extends CamelTestSupport {
>     public void testCamelSerialize() {
>         Exchange exchange = new DefaultExchange(this.context);
>         MyObject object = new MyObject();
>         exchange.setIn(object.toMessage());
>         assertEquals(object, exchange.getIn(MyObject.class);
>     }
> }
>
> If I do this, it doesn't call my type converter method at all:
>
> @Converter
> public static MyObject fromMessage(Message message) {
>     System.out.println("This message never shows up");
>     // more stuff
> }
>
> Am I missing something about how this is supposed to work?

Reply via email to