Re: Struts Unit Tests / Alternative getUserPrincipleCall

2005-04-05 Thread Tim Christopher
Just in case anyone else experiences the same problem this is how I solved it: TestPrincipal user = new TestPrincipal("tim"); ServletContext context = getActionServlet().getServletContext(); HttpServletRequestSimulator hsrs = new HttpServletRequestSimulator(context); hsrs.setUserPrincipal(

Struts Unit Tests / Alternative getUserPrincipleCall

2005-04-05 Thread Tim Christopher
Hi, Does anyone know how to code a response to request.getUserPrinciple().getName()? I've used that call at the start of many of my Actions so that only relevant content would be displayed, however I'm now trying to run unit tests I'm getting no where as the User Principle is not in the request.