Keep session in subsequent Java calls to Play 2.0's fakeRequest
问题 I'm looking for a way to preserve the session when using Play 2.0's fakeRequest in my Java tests, but my attempts fail while invoking methods in the Scala-based JARs. Based on a pull request mentioned in the Scala question Add values to Session during testing (FakeRequest, FakeApplication), I figured the following might work in Java: public Session getSession(Result result) { play.api.mvc.Cookies scalaCookies = play.api.test.Helpers.cookies(result.getWrappedResult()); play.api.mvc.Cookie