Added test to verify LogoutHandlers added to LogoutFilter

This commit is contained in:
Rob Winch 2012-07-18 14:39:15 -05:00
parent 3ce06333c5
commit c7c41ced84
1 changed files with 17 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import org.springframework.security.config.BeanIds
import org.springframework.security.core.userdetails.MockUserDetailsService
import org.springframework.security.util.FieldUtils
import org.springframework.security.web.authentication.logout.LogoutFilter
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler
import org.springframework.security.web.authentication.rememberme.InMemoryTokenRepositoryImpl
import org.springframework.security.web.authentication.rememberme.JdbcTokenRepositoryImpl;
import org.springframework.security.web.authentication.rememberme.PersistentTokenBasedRememberMeServices
@ -110,6 +111,22 @@ class RememberMeConfigTests extends AbstractHttpConfigTests {
rmp.key == "ourkey"
}
def rememberMeAddsLogoutHandlerToLogoutFilter() {
httpAutoConfig () {
'remember-me'()
}
createAppContext(AUTH_PROVIDER_XML)
def rememberMeServices = rememberMeServices()
List logoutHandlers = getFilter(LogoutFilter.class).handlers
expect:
rememberMeServices
logoutHandlers.size() == 2
logoutHandlers.get(0) instanceof SecurityContextLogoutHandler
logoutHandlers.get(1) == rememberMeServices
}
def rememberMeTokenValidityIsParsedCorrectly() {
httpAutoConfig () {
'remember-me'('key': 'ourkey', 'token-validity-seconds':'10000')