Create an endpoint for monitoring the availibilty of this service, and check each connected tool if it is working.
Feature: A simple JSON endpoint that could be called periodically to ensure,
if the application is running or not.
Scenario: Monitor availability
Given the application running
When the '/hearthbeat' endpoint is requested with 'GET' method
Then it should return a JSON like: '{"status": "ok"}'
Feature: Hearthbeat endpoint should check database availability.
Scenario: Monitor database that has one record
Given the application running
And connected to the database
And the database is has 1 record in the 'hearthbeat' table
When the '/hearthbeat' endpoint is requested with 'GET' method
Then it should return a JSON like: '{"status": "ok", "database": "ok"}'
Scenario: Monitor database that has no records
Given the application running
And connected to the database
And the database is has 0 record in the 'hearthbeat' table
When the '/hearthbeat' endpoint is requested with 'GET' method
Then it should return a JSON like: '{"status": "ok", "database": "error"}'
Technical Requirements
Create a database table called 'hearthbeat' that only has one column with boolean type called 'status'.
The application should be deployed to Heroku as a production environment, and the database should be set up on each developer and production environments.
Hearthbeat
Create an endpoint for monitoring the availibilty of this service, and check each connected tool if it is working.
Feature: A simple JSON endpoint that could be called periodically to ensure, if the application is running or not.
Scenario: Monitor availability Given the application running When the '/hearthbeat' endpoint is requested with 'GET' method Then it should return a JSON like: '{"status": "ok"}' Feature: Hearthbeat endpoint should check database availability.
Scenario: Monitor database that has one record Given the application running And connected to the database And the database is has 1 record in the 'hearthbeat' table When the '/hearthbeat' endpoint is requested with 'GET' method Then it should return a JSON like: '{"status": "ok", "database": "ok"}'
Scenario: Monitor database that has no records Given the application running And connected to the database And the database is has 0 record in the 'hearthbeat' table When the '/hearthbeat' endpoint is requested with 'GET' method Then it should return a JSON like: '{"status": "ok", "database": "error"}' Technical Requirements
Create a database table called 'hearthbeat' that only has one column with boolean type called 'status'.
The application should be deployed to Heroku as a production environment, and the database should be set up on each developer and production environments.
The endpoint should be tested using MockMvc