public void testPollingConsumer() throws Exception {
template.sendBodyAndHeader("file:target/enrich", "Hello World", Exchange.FILE_NAME, "hello.txt");
PollingConsumer consumer = context.getEndpoint("file:target/enrich").createPollingConsumer();
consumer.start();
Exchange exchange = consumer.receive(5000);
assertNotNull(exchange);
assertEquals("Hello World", exchange.getIn().getBody(String.class));
// sleep a bit to ensure polling consumer would be suspended after we have used it
Thread.sleep(500);