Skip to content

Instantly share code, notes, and snippets.

@jroper
Created July 2, 2012 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jroper/3034154 to your computer and use it in GitHub Desktop.
Save jroper/3034154 to your computer and use it in GitHub Desktop.
Play sessions
running(fakeApplication(), new Runnable() {
@Override
public void run() {
FakeRequest req = fakeRequest();
for (int i = 0; i < 5; i++) {
req = req.withSession("key" + i, "value" + i);
}
for (int i = 0; i < 5; i++) {
if (!req.getWrappedRequest().session().get("key" + i).isDefined()) {
// Whether we reach this point or not depends on HashMap ordering
System.out.println("key" + i + " not found!");
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment