From 5f23b3c272c111011c765e5144ef8b488427f16e Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Tue, 9 Feb 2016 08:24:33 -0600 Subject: [PATCH] Null check for hazelcastInstance Previously if the hazelcastInstance failed to start we would get a NPE when the tests ended. This would mask the original issue of starting the hazelcastInstance. This commit ensures that hazelcastInstance is non-null before trying to shut it down. Polish gh-360 Relates to gh-360 --- .../session/hazelcast/HazelcastClientRepositoryITests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-session/src/integration-test/java/org/springframework/session/hazelcast/HazelcastClientRepositoryITests.java b/spring-session/src/integration-test/java/org/springframework/session/hazelcast/HazelcastClientRepositoryITests.java index 1a0824d..bdbf19e 100644 --- a/spring-session/src/integration-test/java/org/springframework/session/hazelcast/HazelcastClientRepositoryITests.java +++ b/spring-session/src/integration-test/java/org/springframework/session/hazelcast/HazelcastClientRepositoryITests.java @@ -59,7 +59,9 @@ public class HazelcastClientRepositoryITests @AfterClass public static void teardown() { - hazelcastInstance.shutdown(); + if(hazelcastInstance != null) { + hazelcastInstance.shutdown(); + } } @Configuration