Re: Strange MockEndpoint.expectedBodiesReceived behaviour

2012-11-05 Thread Claus Ibsen
Make sure you set you expectations on the mocks first in your unit test. Before any messages gets routed etc. On Mon, Nov 5, 2012 at 9:27 PM, David Karlsen wrote: > I'm confused about how expectedBodiesReceived behaves. > > I have a route where I mock a jms endpoint (the endpoint is sent to in >

Re: Strange MockEndpoint.expectedBodiesReceived behaviour

2012-11-05 Thread David Karlsen
Doesn't this code look suspicious (look at actual bodies): public void expectedBodiesReceived(final List bodies) { expectedMessageCount(bodies.size()); this.expectedBodyValues = bodies; this.actualBodyValues = new ArrayList(); expects(new Runnable() { p

Re: Strange MockEndpoint.expectedBodiesReceived behaviour

2012-11-05 Thread David Karlsen
Same: Body of message: 0. Expected: <: > Try setting the expectation before you actually hit the endpoint with any > messages. Hit the endpoint with your test logic. Then assert. > > Does it work then? > > Regards. > > Sent from a mobile device > On 5 Nov 2012 20:27, "David Karlsen" wrote: > >> I

Re: Strange MockEndpoint.expectedBodiesReceived behaviour

2012-11-05 Thread Raul Kripalani
Try setting the expectation before you actually hit the endpoint with any messages. Hit the endpoint with your test logic. Then assert. Does it work then? Regards. Sent from a mobile device On 5 Nov 2012 20:27, "David Karlsen" wrote: > I'm confused about how expectedBodiesReceived behaves. > >

Strange MockEndpoint.expectedBodiesReceived behaviour

2012-11-05 Thread David Karlsen
I'm confused about how expectedBodiesReceived behaves. I have a route where I mock a jms endpoint (the endpoint is sent to in an onException route as follows: java.lang.Exception true