}
@Test
public void testDirectExchangeBindings() throws Exception {
RabbitTemplate template = new RabbitTemplate(connectionFactory);
template.convertAndSend(directTest.getName(), queue.getName(), "message");
Thread.sleep(200);
String result = (String) template.receiveAndConvert(queue.getName());
assertEquals("message", result);
template.convertAndSend(directTest.getName(), "", "message2");
Thread.sleep(200);
assertNull(template.receiveAndConvert(queue.getName()));
result = (String) template.receiveAndConvert(queue2.getName());
assertEquals("message2", result);
template.convertAndSend(directTest.getName(), queue2.getName(), "message2");
Thread.sleep(200);
assertNull(template.receiveAndConvert(queue2.getName()));
template.convertAndSend(directTest.getName(), queue3.getName(), "message2");
Thread.sleep(200);
result = (String) template.receiveAndConvert(queue3.getName());
assertEquals("message2", result);
}