Bläddra i källkod

Correct NullPointerException as fixture missing an ApplicationContext and attempting to publish an event.

Ben Alex 20 år sedan
förälder
incheckning
798ebb1a3d

+ 6 - 1
core/src/test/java/org/acegisecurity/providers/ConcurrentSessionControllerImplTests.java

@@ -37,7 +37,7 @@ import java.security.Principal;
 public class ConcurrentSessionControllerImplTests extends TestCase {
     //~ Instance fields ========================================================
 
-    ConcurrentSessionControllerImpl target = new ConcurrentSessionControllerImpl();
+    ConcurrentSessionControllerImpl target;
 
     //~ Methods ================================================================
 
@@ -244,6 +244,11 @@ public class ConcurrentSessionControllerImplTests extends TestCase {
         target.removeSession("nothing to see here");
     }
 
+    protected void setUp() throws Exception {
+        target = new ConcurrentSessionControllerImpl();
+        target.setApplicationContext(MockApplicationContext.getContext());
+    }
+
     private Authentication createAuthentication(String user, String password,
         String sessionId) {
         UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(user,