expectedBodies also set expected number of messages. So you say 2 bodies expected and then 12 message later. That is a mis match.
On Fri, Jul 4, 2014 at 7:20 AM, Jan Matèrne (jhm) <apa...@materne.de> wrote: > I ran into the same problem some ago with another expect* method. > These methods set the extpectedMessageCount to the number of arguments. > > The simplest thing what you could do is: > endpoint.setExpectedBodies(“hello”, "hello"); > > I am not sure that changing the order would work > endpoint.setExpectedBodies(“hello”); > endpoint.setExpectedMessageCount(2); > > You could write the test for yourself: > expects(new Runnable(){ > ... > }); > > Or use allMessages() ... > > > Jan > > >> -----Ursprüngliche Nachricht----- >> Von: Minh Tran [mailto:darth.minhs...@gmail.com] >> Gesendet: Freitag, 4. Juli 2014 04:00 >> An: users@camel.apache.org >> Betreff: MockEndPoint expected methods clashing >> >> Hi >> >> I’m calling setExpectedMessageCount and expectedBodiesReceived like >> this and seeing odd behaviour >> >> endpoint.setExpectedMessageCount(2); >> endpoint.setExpectedBodies(“hello”); >> >> I would expect that it will attempt to find 2 messages with both bodies >> containing “hello”. Instead it appears as though the second call >> overwrites the expected message count back to 1. Is this expected >> behaviour? >> >> If so, how do I achieve what I want so that it finds the number of >> messages I need without me having to specify the body over and over? > -- Claus Ibsen ----------------- Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/