Hello!
  Set RabbitMQUtils as transient field in order to get rid of serialization
error. See if you can mock (Mockito using)  your RabbitMQ utils and inject
it via setMQ.
Hope that these help.
 Regards,
 Florin

On Tue, Jan 19, 2016 at 7:16 PM, Noppanit Charassinvichai <
noppani...@gmail.com> wrote:

> I'm trying to unit test my Bolt which has dependency to RabbitMQ.
>
> This is what I put in my prepare method.
>
>     @Override
>     public void prepare(Map map, TopologyContext topologyContext,
> OutputCollector outputCollector) {
>         this.outputCollector = outputCollector;
>         this.gson = new Gson();
>         this.rabbitMQUtils = new RabbitMQUtils(this.config);
>     }
>
> If I change that to inject RabbitMQUtils I get an Exception telling me
> that some classes in RabbitMQ API cannot be serialized.
>
> What do people do to unit test something like this?
>
> Thanks.
>

Reply via email to