@Test
public void testPublish() throws Exception {

	new Expectations() {{
		channel.exchangeDeclare(EXCHANGE, EXCHANGE_TYPE, true);
		channel.basicPublish(EXCHANGE, ROUTING_KEY, null, MESSAGE.getBytes(StandardCharsets.UTF_8));
		channel.isOpen(); result = true;
		channel.close();
		connection.createChannel(); result = channel;
		connection.isOpen(); result = true;
		connection.close();
		factory.setUri(URI);
		factory.newConnection(); result = connection;
	}};
	publisher.connect(URI, EXCHANGE, EXCHANGE_TYPE);
	publisher.publish(MESSAGE, ROUTING_KEY);
	publisher.close();
}