/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-2020 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.
package org.onap.policy.models.dao;
+import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Date;
pfDao.getConcept(PfReferenceKey.class, nullRefKey);
pfDao.size(null);
- pfDao.close();
+ assertThatCode(() -> pfDao.close()).doesNotThrowAnyException();
}
private void testAllOps() {
pfDao.create(keyInfo0);
final DummyConceptEntity keyInfoBack0 = pfDao.get(DummyConceptEntity.class, aKey0);
- assertTrue(keyInfo0.equals(keyInfoBack0));
+ assertEquals(keyInfo0, keyInfoBack0);
final DummyConceptEntity keyInfoBackNull = pfDao.get(DummyConceptEntity.class, PfConceptKey.getNullKey());
assertNull(keyInfoBackNull);
final DummyConceptEntity keyInfoBack1 = pfDao.getConcept(DummyConceptEntity.class, aKey0);
- assertTrue(keyInfoBack0.equals(keyInfoBack1));
+ assertEquals(keyInfoBack0, keyInfoBack1);
final DummyConceptEntity keyInfoBack2 =
pfDao.getConcept(DummyConceptEntity.class, new PfConceptKey("A-KEY3", VERSION001));
Set<DummyConceptEntity> keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
keyInfoSetIn.add(keyInfo0);
- assertTrue(keyInfoSetIn.equals(keyInfoSetOut));
+ assertEquals(keyInfoSetIn, keyInfoSetOut);
pfDao.delete(keyInfo1);
keyInfoSetIn.remove(keyInfo1);
keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
- assertTrue(keyInfoSetIn.equals(keyInfoSetOut));
+ assertEquals(keyInfoSetIn, keyInfoSetOut);
pfDao.deleteCollection(keyInfoSetIn);
keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
keyInfoSetIn.add(keyInfo0);
pfDao.createCollection(keyInfoSetIn);
keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
- assertTrue(keyInfoSetIn.equals(keyInfoSetOut));
+ assertEquals(keyInfoSetIn, keyInfoSetOut);
pfDao.delete(DummyConceptEntity.class, aKey0);
keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
keyInfoSetIn.add(keyInfo0);
pfDao.createCollection(keyInfoSetIn);
keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
- assertTrue(keyInfoSetIn.equals(keyInfoSetOut));
+ assertEquals(keyInfoSetIn, keyInfoSetOut);
pfDao.deleteAll(DummyConceptEntity.class);
assertEquals(0, pfDao.size(DummyConceptEntity.class));