green-fox-academy / hotel-booking-user-service

0 stars 0 forks source link

RabbitMQ in hearthbeat #7

Open vvarro opened 7 years ago

vvarro commented 7 years ago

RabbitMQ in hearthbeat

The hearthbeat endpoint should check the RabbitMQ connection and push and consume a message.

Feature: Hearthbeat endpoint should check message queue availability.

Scenario: Monitor queue that has no items Given the application running And connected to RabbitMQ And the 'heartbeat' queue is empty When the '/hearthbeat' endpoint is requested with 'GET' method Then it should send a message to the 'heartbeat' queue and consume that message right after And it should return a JSON like: '{"status": "ok", "database": "ok", "queue": "ok"}'

Scenario: Monitor queue that has items Given the application running And connected to RabbitMQ And the 'heartbeat' queue is not empty When the '/hearthbeat' endpoint is requested with 'GET' method Then it should return a JSON like: '{"status": "ok", "database": "ok", "queue": "error"}'

Scenario: Monitor queue that is not connected Given the application running And not connected to RabbitMQ When the '/hearthbeat' endpoint is requested with 'GET' method Then it should return a JSON like: '{"status": "ok", "database": "ok", "queue": "error"}'

vvarro commented 7 years ago

Estimation: 13