validateDroppedExchanges(sentExchanges, mock.getReceivedCounter());
}
public void testBurstySampling() throws Exception {
NotifyBuilder notify = new NotifyBuilder(context).whenDone(5).create();
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMinimumMessageCount(2);
mock.setResultWaitTime(3000);
List<Exchange> sentExchanges = new ArrayList<Exchange>();
// send a burst of 5 exchanges, expecting only one to get through
sendExchangesThroughDroppingThrottler(sentExchanges, 5);
// sleep through a complete period
Thread.sleep(1100);
// send another 5 now
sendExchangesThroughDroppingThrottler(sentExchanges, 5);
notify.matchesMockWaitTime();
mock.assertIsSatisfied();
validateDroppedExchanges(sentExchanges, mock.getReceivedCounter());
}