Added test to verify LogoutHandlers added to LogoutFilter
This commit is contained in:
parent
3ce06333c5
commit
c7c41ced84
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue