List of usage examples for org.apache.wicket.protocol.http WebSession setAttribute
public final Session setAttribute(String name, Serializable value)
From source file:org.geoserver.web.GeoServerSecuredPageTest.java
License:Open Source License
@Test public void testSessionFixationAvoidance() throws Exception { tester.startPage(GeoServerHomePage.class); final WebSession session = WebSession.get(); session.bind(); // fore session creation session.setAttribute("test", "whatever"); // login, this will invalidate the session tester.startPage(GeoServerHomePage.class); MockHttpServletRequest request = createRequest("login"); request.setMethod("POST"); request.setParameter("username", "admin"); request.setParameter("password", "geoserver"); dispatch(request);// ww w .java2 s . com // the session in wicket tester mock does not disappear, the only // way to see if it has been invalidated is to check that the attributes are gone... assertNull(session.getAttribute("test")); }