@Test
	public void testReceive() {
		try {
			consumer = new AbstractMessageConsumer(mockTopic) {
			};
		} catch (DestinationClosedException e) {
			fail("Unexpected exception on constructor");
		}
		assertNotNull(mockTopic.getTopicSubscriber());
		try {
			Message msg = new MockMessage("TestMessage");
			mockTopic.getTopicSubscriber().onMessage(msg);
			FutureTask<Message> future = getMessageFuture(consumer);
			Message received = future.get(5, TimeUnit.MILLISECONDS);
			assertNotNull("Received message is null ", received);
			assertEquals("Message values dont match.", msg.getMessage(),
					received.getMessage());
		} catch (TimeoutException e) {
			fail("Did not receive message in time");
		} catch (Exception e) {
			logger.error("Error while calling receiving message", e);
			fail("Error while calling onMessage:" + e.getMessage());
		}
	}