Skip to content

Instantly share code, notes, and snippets.

@joelso
Created August 26, 2012 21:42
Show Gist options
  • Save joelso/3483765 to your computer and use it in GitHub Desktop.
Save joelso/3483765 to your computer and use it in GitHub Desktop.
withSession issue
import org.junit.Test;
import play.test.FakeRequest;
import static org.junit.Assert.assertEquals;
import static play.test.Helpers.fakeApplication;
import static play.test.Helpers.running;
public class WithSessionTest {
@Test
public void testWithSession() throws Exception {
running(fakeApplication(), new Runnable() {
public void run() {
FakeRequest req = new FakeRequest().withSession("1", "1").withSession("2", "2");
//assertEquals(2, req.getWrappedRequest().session().data().size());
assertEquals("1", req.getWrappedRequest().session().get("1").get());
assertEquals("2", req.getWrappedRequest().session().get("2").get());
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment