import java.util.TreeSet;
import java.util.UUID;
import org.eclipse.persistence.config.PersistenceUnitProperties;
+import org.junit.After;
import org.junit.Test;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfModelException;
private static final Instant TIMESTAMP2 = Instant.ofEpochSecond(1613494293).plusSeconds(90);
private PfDao pfDao;
+ /**
+ * Closes the DAO.
+ */
+ @After
+ public void tearDown() {
+ if (pfDao != null) {
+ pfDao.close();
+ pfDao = null;
+ }
+ }
+
@Test
public void testEntityTestSanity() throws PfModelException {
final DaoParameters daoParameters = new DaoParameters();
assertThatThrownBy(() -> pfDao.create(new PfConceptKey()))
.hasMessage("Policy Framework DAO has not been initialized");
-
- pfDao.close();
}
@Test
testVersionOps();
testgetFilteredOps();
-
- pfDao.close();
}
@Test
pfDao.getConcept(PfConceptKey.class, nullKey);
pfDao.getConcept(null, nullRefKey);
pfDao.getConcept(PfReferenceKey.class, nullRefKey);
- pfDao.size(null);
- assertThatCode(() -> pfDao.close()).doesNotThrowAnyException();
+ assertThatCode(() -> pfDao.size(null)).doesNotThrowAnyException();
}
private void testAllOps() {