From 798ebb1a3ddd3c78890e376dea270c6ec5fb9443 Mon Sep 17 00:00:00 2001 From: Ben Alex Date: Sun, 27 Mar 2005 08:40:09 +0000 Subject: [PATCH] Correct NullPointerException as fixture missing an ApplicationContext and attempting to publish an event. --- .../providers/ConcurrentSessionControllerImplTests.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/test/java/org/acegisecurity/providers/ConcurrentSessionControllerImplTests.java b/core/src/test/java/org/acegisecurity/providers/ConcurrentSessionControllerImplTests.java index 28539dfd57..9111ebb41c 100644 --- a/core/src/test/java/org/acegisecurity/providers/ConcurrentSessionControllerImplTests.java +++ b/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,