protected void authenticateUser(String username, String role)
throws RollerException {
MockHttpServletRequest mockRequest = getMockFactory().getMockRequest();
mockRequest.setRemoteUser(username);
mockRequest.setUserPrincipal(new MockPrincipal(username));
mockRequest.setUserInRole(role, true);
HttpSession session = mockRequest.getSession(true);
UserManager umgr = RollerFactory.getRoller().getUserManager();
UserData user = umgr.getUserByUserName(username);