camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Minh Tran <darth.minhs...@gmail.com>
Subject Re: mocking Type Converters
Date Tue, 24 Nov 2015 06:22:10 GMT
Thanks for the tip Claus!

> On 24 Nov 2015, at 5:19 PM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> 
> You can just add a new type converter to the type converter registry
> to override any existing.
> 
> See more at
> http://camel.apache.org/type-converter.html
> 
> On Tue, Nov 24, 2015 at 7:14 AM, Minh Tran <darth.minhster@gmail.com> wrote:
>> Hi
>> 
>> I was wondering if it was possible to mock sections of my route in unit tests that
are using a type converter. e.g.
>> 
>> convertBodyTo(PO.class)
>> 
>> My converter class looks something like
>> 
>> public class PurchaseOrderConverter implements TypeConverters {
>>   @Converter
>>   public PO convert(XYZ xyz) {
>>    …..
>>   }
>> }
>> 
>> From my understanding, these type converters aren’t spring beans so I can't inject
mocked beans. And I don’t believe @MockEndpoints will mock these things either. Any ideas?
I’m using Camel 2.16.1. Thanks.
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Mime
View raw message