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();