Browse Source

SEC-428: Make sure context is cleared before running test.

2.0.x
Luke Taylor 18 years ago
parent
commit
f8b5000d40
  1. 7
      core/src/test/java/org/springframework/security/intercept/method/aopalliance/MethodSecurityInterceptorWithAopConfigTests.java

7
core/src/test/java/org/springframework/security/intercept/method/aopalliance/MethodSecurityInterceptorWithAopConfigTests.java

@ -1,10 +1,12 @@ @@ -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 { @@ -30,6 +32,11 @@ public class MethodSecurityInterceptorWithAopConfigTests {
private AbstractXmlApplicationContext appContext;
@Before
public void clearContext() {
SecurityContextHolder.clearContext();
}
@After
public void closeAppContext() {
if (appContext != null) {

Loading…
Cancel
Save