-
Notifications
You must be signed in to change notification settings - Fork 5
Chapter Ten Lab
jrupiper edited this page Jul 7, 2017
·
1 revision
In the previous labs, we created a set of controller methods following best practices and strong TDD paradigms. We will now add an easter egg to the HeartbeatController /upper method and add the ability to serve a file from the controller. These two labs are standalone and are not required for any additional functionality.
- Add an "easter egg" to the upper method of Heartbeat controller where the application responds with a 418 (I_AM_A_TEAPOT) status when given "teapot" as the message.
- Create a new test within
HeartbeatControllerTestcalled upperTeapot that verifies the correct status is returned for "teapot" - we need to test our easter egg after all... - Be sure to test that the status is returned correctly via Postman or another POST utility.
In this lab you will add a new method to HeartbeatController that serves a file to a client (you choose the file, can be an image, text file, etc).
- Add a GET method named whatever you like that serves a file of your choosing in the
HeartbeatController.
- For example, a getPokemonNames method could return a text file with a list of pokemon names (this wouldn't be dynamic) or a getPokemonLogo method could return an image with the pokemon logo.
- There are lots of ways to do this lab... use google to help you find at least one example
- (Extra Credit) Add a test to
HeartbeatControllerTestto test the method.