-
Notifications
You must be signed in to change notification settings - Fork 1
Sprint 2 Additional Features (Bonus)
This section outlines additional features that were implemented for Deliverable 2.
Integration testing using the Heroku database proved to be very cumbersome. To avoid this, an H2 in-memory database was used to run integration tests. Using an H2 database provides several advantages:
- Reduces runtime significantly
- Ensures that test results are independent of other simultaneous operations taking place on the Heroku database
- Allows adding the Business Methods and RESTful Services integration test layers to the continuous integration system
In addition to implementing the basic required RESTful services, we added features to make the API consistent, and user-friendly:
- Comprehensive error handling that returns an appropriate HTTP status and error message depending on the error that occurred. This is in contrast to the default behavior which would return HTTP status 500 if any error occurred.
- For POST requests, in addition to returning the appropriate HTTP status, the location URI of the created entity is returned in the response header and body. This makes it easy for users to make a corresponding GET request for the created entity.
In addition to implementing the required integration tests, we also provided tests for all of our documented GET endpoints. Moreover, for our external integrations tests (those which test other teams' query endpoints), we make corresponding POST requests before the tests, and then verify if the response body is as expected (in contrast to verifying the HTTP status only).