/** * Returns a {@link WikiContext} for the given page, with user {@link Users#JANNE} logged in. * * @param page given {@link WikiPage}. * @return {@link WikiContext} associated to given {@link WikiPage}. * @throws WikiException problems while logging in. */ WikiContext getJanneBasedWikiContextFor(WikiPage page) throws WikiException { MockHttpServletRequest request = testEngine.newHttpRequest(); WikiSession session = WikiSession.getWikiSession(testEngine, request); testEngine.getAuthenticationManager().login(session, request, Users.JANNE, Users.JANNE_PASS); return new WikiContext(testEngine, request, page); }