I\'ve been trying to create an Http.Context for tests using its constructor unsuccessfully. Does anybody see what I\'m doing wrong?
I\'ve looked at the following but
Looks like this seems to have fixed it for me:
@Before
public void setUp() throws Exception {
Map flashData = Collections.emptyMap();
Map argData = Collections.emptyMap();
Long id = 2L;
play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);
Http.Context context = new Http.Context(id, header, request, flashData, flashData, argData);
Http.Context.current.set(context);
}
The part that fixes it specifically is:
Http.Context.current.set(context);