In one of my project we were reading the cookies so that we could do the processing accordingly. Now reading the cookie is easy but writing a unit test case for that action was little bit tricky for me because I wanted to test the behavior in case of when I find the cookie and when there is no desired cookie in the request. So the question was how to add cookie into the mocked request.
To do this I did the following in my unit test setup
Cookie cookie = new Cookie("APPNAME", "ABCD") mockRequest.cookies = [cookie].toArray()
Now I can test my action easily :).