}
public void testCacheConsumers() throws Exception {
ConsumerTemplate template = new DefaultConsumerTemplate(context);
template.setMaximumCacheSize(500);
template.start();
assertEquals("Size should be 0", 0, template.getCurrentCacheSize());
// test that we cache at most 500 consumers to avoid it eating to much memory
for (int i = 0; i < 503; i++) {