Use WebAuthenticationDetails for Authentication.getDetails() by default.

This commit is contained in:
Ben Alex
2005-02-21 00:09:49 +00:00
parent 436d37c166
commit e52f3eacb1
8 changed files with 140 additions and 17 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright 2004 Acegi Technology Pty Limited
/* Copyright 2004, 2005 Acegi Technology Pty Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,7 +55,7 @@ public class MockHttpSession implements HttpSession {
}
public String getId() {
throw new UnsupportedOperationException("mock method not implemented");
return "3984594856968";
}
public long getLastAccessedTime() {

View File

@@ -1,4 +1,4 @@
/* Copyright 2004 Acegi Technology Pty Limited
/* Copyright 2004, 2005 Acegi Technology Pty Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@ import net.sf.acegisecurity.Authentication;
import net.sf.acegisecurity.MockAuthenticationManager;
import net.sf.acegisecurity.MockHttpServletRequest;
import net.sf.acegisecurity.MockHttpSession;
import net.sf.acegisecurity.ui.WebAuthenticationDetails;
/**
@@ -72,7 +73,8 @@ public class AuthenticationProcessingFilterTests extends TestCase {
Authentication result = filter.attemptAuthentication(request);
assertTrue(result != null);
assertEquals("127.0.0.1", result.getDetails());
assertEquals("127.0.0.1",
((WebAuthenticationDetails) result.getDetails()).getRemoteAddress());
}
public void testNullPasswordHandledGracefully() throws Exception {