The following code (
taken from my demo app on GitHub) suggests to me that
play.api.test.route ignores the
FakeRequest path. This unit test is written with
scalatestplus-play 1.5.1.
route(app, FakeRequest(GET, "/b/serviceB")).foreach { result =>
status(result) mustBe OK // not sure why this fails with status 404
contentAsString(result) must include ("This is serviceB")
}
Does not matter what path I provide, I always get an HTTP status 404 back. BTW, this webapp uses 3 subprojects, this test should use the subproject with the
/b routing prefix. I tried not using the prefix, not prefixing with a slash ... always 404. Click through the link above to see the rest of the code.