for (Object consumer : consumers) {
ChannelProxy channel = TestUtils.getPropertyValue(consumer, "channel", ChannelProxy.class);
if (channel != null && channel.getTargetChannel() == mockChannel) {
Consumer rabbitConsumer = TestUtils.getPropertyValue(consumer, "consumer", Consumer.class);
if (cancel) {
rabbitConsumer.handleCancelOk((String) invocation.getArguments()[0]);
}
else {
rabbitConsumer.handleConsumeOk("foo");
}
latch.countDown();