236237238239240241242243244245
private Application invalidateSession() { return new Application() { public void handle(Request request, Response response) throws Exception { Session session = Session.get(request); session.put("written", true); session.invalidate(); } }; } }
106107108109110111112113114115116
} @Test(expected = IllegalStateException.class) public void forbidsSavingInvalidSessions() { Session data = new Session(); data.invalidate(); pool.save(data); } @Test public void marksSessionUpdateTime() throws InterruptedException {
5152535455565758596061
}); delete("/logout").to(new Application() { public void handle(Request request, Response response) throws Exception { Session session = Session.get(request); session.invalidate(); response.redirectTo("/"); } }); }} );