added fix to preserve custom UserDetails implementations (Matt DeHoust fix recommendation)

This commit is contained in:
Mark St. Godard
2005-09-19 02:22:44 +00:00
parent d44b570087
commit 24394b7b2b
2 changed files with 3 additions and 2 deletions

View File

@@ -355,7 +355,8 @@ public class SwitchUserProcessingFilterTests extends TestCase {
Authentication targetAuth = SecurityContextHolder.getContext()
.getAuthentication();
assertNotNull(targetAuth);
assertEquals("jacklord", targetAuth.getPrincipal());
assertTrue(targetAuth.getPrincipal() instanceof UserDetails);
assertEquals("jacklord", ((User)targetAuth.getPrincipal()).getUsername());
}
private MockHttpServletRequest createMockSwitchRequest() {