Adding Authentication and Testing the Restaurant Review server

In our next assignment you will be adding authentication and testing to your review server.

What to do

To add authentication to your application, start by reviewing the lecture notes I posted on Authentication. You can copy many of the classes I created to authenticate the Auction example. The main change you are going to need to make will be in setting up the authetication configuration. There is a place there where you will specify which controller methods in your application will require authentication and which will not. Update those settings to meet your needs.

The other major change you will need to make is to rewrite some of your controller methods to work with Authentication objects. Again, see my notes for how to do that.

After adding authentication you are now ready to write end-to-end tests to test your application. Start by reviewing my lecture notes on testing to see how to set up end-to-end tests with the REST Assured library and JUnit.

You will need to write a test for every method in every controller in your application. Be sure to think about an appropriate sequence for running these tests: define your tests in an order that ensures that any test that fetches data from the server was preceded by a test that posts data to the server first.