From f8b5000d4063b8dd7bf5c69288e1a5cceb13e604 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Mon, 24 Mar 2008 22:56:43 +0000 Subject: [PATCH] SEC-428: Make sure context is cleared before running test. --- .../MethodSecurityInterceptorWithAopConfigTests.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/test/java/org/springframework/security/intercept/method/aopalliance/MethodSecurityInterceptorWithAopConfigTests.java b/core/src/test/java/org/springframework/security/intercept/method/aopalliance/MethodSecurityInterceptorWithAopConfigTests.java index fadae5d4c9..337cd9b5d7 100644 --- a/core/src/test/java/org/springframework/security/intercept/method/aopalliance/MethodSecurityInterceptorWithAopConfigTests.java +++ b/core/src/test/java/org/springframework/security/intercept/method/aopalliance/MethodSecurityInterceptorWithAopConfigTests.java @@ -1,10 +1,12 @@ package org.springframework.security.intercept.method.aopalliance; import org.junit.After; +import org.junit.Before; import org.junit.Test; import org.springframework.context.support.AbstractXmlApplicationContext; import org.springframework.security.AuthenticationCredentialsNotFoundException; import org.springframework.security.ITargetObject; +import org.springframework.security.context.SecurityContextHolder; import org.springframework.security.util.InMemoryXmlApplicationContext; /** @@ -30,6 +32,11 @@ public class MethodSecurityInterceptorWithAopConfigTests { private AbstractXmlApplicationContext appContext; + @Before + public void clearContext() { + SecurityContextHolder.clearContext(); + } + @After public void closeAppContext() { if (appContext != null) {