hpi-schul-cloud / gamification

A reusable microservice for gamification.
GNU Affero General Public License v3.0
44 stars 17 forks source link

Test amqp #52

Open frederike-ramin opened 6 years ago

frederike-ramin commented 6 years ago

Currently there are no tests for amqp.

Can be implemented via Dependency Injection.

cmfcmf commented 6 years ago

Can be implemented via Dependency Injection.

To give some more context, the AmqpConnector should be refactored to receive the amqplib instance during construction. This allows a test to supply a fake amqplib instance which doesn't communicate to any real amqp service, but rather spies on the invoked methods and asserts that certain methods have been called. The Mocha docs have a list of supported spying libraries.