For WebRequest and ServletUnitHttpRequest objects define the UserPrincipal field and allow them to be set by JUnit tests. I have several tests where I need to set a mock UserPrincipal object in order to test user specific code. Without the ability to set the UserPrincipal field in the WebRequest object I can't inject different users for different tests. This makes the testing framework practically useless to me for these servlets.
Log in to post a comment.