amqp tests refactored