Use WebAuthenticationDetails for Authentication.getDetails() by default.
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user