From 22225effcca867527a8e1d2e38821b84ebcd7f45 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Fri, 30 Dec 2011 14:30:17 -0600 Subject: [PATCH] Call SecurityContextHolder.clearContext() in tear down of HttpSessionSecurityContextRepositoryTests --- .../context/HttpSessionSecurityContextRepositoryTests.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/src/test/java/org/springframework/security/web/context/HttpSessionSecurityContextRepositoryTests.java b/web/src/test/java/org/springframework/security/web/context/HttpSessionSecurityContextRepositoryTests.java index 6e9e3e91a3..76f0bdfcf2 100644 --- a/web/src/test/java/org/springframework/security/web/context/HttpSessionSecurityContextRepositoryTests.java +++ b/web/src/test/java/org/springframework/security/web/context/HttpSessionSecurityContextRepositoryTests.java @@ -6,6 +6,7 @@ import static org.springframework.security.web.context.HttpSessionSecurityContex import javax.servlet.http.HttpSession; +import org.junit.After; import org.junit.Test; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.mock.web.MockHttpServletResponse; @@ -18,6 +19,11 @@ import org.springframework.security.core.context.SecurityContextHolder; public class HttpSessionSecurityContextRepositoryTests { private final TestingAuthenticationToken testToken = new TestingAuthenticationToken("someone", "passwd", "ROLE_A"); + @After + public void tearDown() { + SecurityContextHolder.clearContext(); + } + @Test public void sessionIsntCreatedIfContextDoesntChange() throws Exception { HttpSessionSecurityContextRepository repo = new HttpSessionSecurityContextRepository();