Permalink
Browse files

Added test to verify LogoutHandlers added to LogoutFilter

  • Loading branch information...
1 parent 3ce0633 commit c7c41ced845b511798200143971fa595e0249af9 @rwinch rwinch committed Jul 18, 2012
@@ -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')

0 comments on commit c7c41ce

Please sign in to comment.