The expectedBodyReceived will override the count, where you set only 1 body and hence 1 message received.
If you want to expect that all message bodies contains okay, then use .allMessages().body(). instead On Sat, Feb 20, 2016 at 12:13 AM, zappee <[email protected]> wrote: > Hi, > > How can I set the value of the expected message count? In my test scenario > it is set to 200 but I got a Expected: <1> but was: <0> instead of > Expected: <200> but was: <0> > > MockEndpoint resultEndpoint = getMockEndpoint(ENDPOINT_URL); > resultEndpoint.expectedMessageCount(200); > resultEndpoint.expectedBodyReceived().body().contains("okay"); > template.sendBodyAndHeader(ENDPOINT_URL, "abc"); > assertMockEndpointsSatisfied(); > > Error message: > java.lang.AssertionError: mock://result Received message count. Expected: > <1> but was: <0> > Expected :<1> > Actual :<0> > > > What did I do wrong? > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/expectedMessageCount-is-not-considered-tp5777959.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2
