aboutsummaryrefslogtreecommitdiffstats
path: root/feature-session-persistence/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'feature-session-persistence/src/test')
-rw-r--r--feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/GenSchema.java8
-rw-r--r--feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/PersistenceFeatureTest.java5
2 files changed, 4 insertions, 9 deletions
diff --git a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/GenSchema.java b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/GenSchema.java
index 38e3ec23..40918312 100644
--- a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/GenSchema.java
+++ b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/GenSchema.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* feature-session-persistence
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,8 +34,6 @@ public class GenSchema {
private static final Logger logger = LoggerFactory.getLogger(PersistenceFeatureTest.class);
- private EntityManagerFactory emf;
-
/**
* Opens the EMF, which generates the schema, as a side-effect.
*
@@ -47,9 +45,7 @@ public class GenSchema {
propMap.put("javax.persistence.jdbc.driver", "org.h2.Driver");
propMap.put("javax.persistence.jdbc.url", "jdbc:h2:mem:JpaDroolsSessionConnectorTest");
- emf = Persistence.createEntityManagerFactory("schemaDroolsPU", propMap);
-
- emf.close();
+ Persistence.createEntityManagerFactory("schemaDroolsPU", propMap).close();
}
/**
diff --git a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/PersistenceFeatureTest.java b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/PersistenceFeatureTest.java
index 1bab1977..e15f57ce 100644
--- a/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/PersistenceFeatureTest.java
+++ b/feature-session-persistence/src/test/java/org/onap/policy/drools/persistence/PersistenceFeatureTest.java
@@ -114,7 +114,6 @@ public class PersistenceFeatureTest {
private KieSessionConfiguration kiecfg;
private KieBase kiebase;
private KieStoreServices kiestore;
- private KieContainer kiecont;
private TransactionManager transmgr;
private UserTransaction usertrans;
private TransactionSynchronizationRegistry transreg;
@@ -166,7 +165,6 @@ public class PersistenceFeatureTest {
kiecfg = mock(KieSessionConfiguration.class);
kiebase = mock(KieBase.class);
kiestore = mock(KieStoreServices.class);
- kiecont = mock(KieContainer.class);
transmgr = mock(TransactionManager.class);
usertrans = mock(UserTransaction.class);
transreg = mock(TransactionSynchronizationRegistry.class);
@@ -176,7 +174,7 @@ public class PersistenceFeatureTest {
emfCount = 0;
jpaCount = 0;
propName = null;
-
+
feat = new PersistenceFeatureImpl();
props.putAll(stdprops);
@@ -188,6 +186,7 @@ public class PersistenceFeatureTest {
when(kiesvc.getStoreServices()).thenReturn(kiestore);
when(kiesvc.newKieSessionConfiguration()).thenReturn(kiecfg);
+ KieContainer kiecont = mock(KieContainer.class);
when(polcont.getKieContainer()).thenReturn(kiecont);
when(polsess.getPolicyContainer()).thenReturn(polcont);