You create a return route this way:
[full package name].routes.[controller].[method]
In your example:
controllers.routes.Authentication.authenticate controllers.routes.Events.events
But say you broke your packages like controllers.auth and controllers.content , then they will be:
controllers.auth.routes.Authentication.authenticate controllers.content.routes.Events.events
Return routes return a Call that contains the HTTP method and URI. In your tests, you can build FakeRequest with Call :
FakeRequest(controllers.routes.Authentication.authenticate)
And you can also use it to check the redirect URI:
val call: Call = controllers.routes.Events.events redirectLocation(loginResult) must beSome(call.url)
source share