159160161162163164165166167168169
// a session.bind mock.setupRequestAndResponse(); try { ((WaspAuthorizationStrategy) mock.getWicketSession().getAuthorizationStrategy()) .login(new PrimaryLoginContext()); } catch (LoginException e) { fail(e.getMessage()); }
8586878889909192939495
try { LoginContext context; if ("test".equals(username)) { context = new PrimaryLoginContext(); } else if ("all".equals(username)) { context = new CustomLoginContext(new SimplePrincipal("all permissions")); }
public Session newSession(Request request, Response response) { WaspSession session = (WaspSession) super.newSession(request, response); try { session.login(new PrimaryLoginContext()); } catch (LoginException e) { throw new RuntimeException(e); }