From dbb37442ecf243d3bcaf50f908691ad6f810ccfc Mon Sep 17 00:00:00 2001 From: uj426b Date: Fri, 31 Jul 2020 12:06:01 -0400 Subject: Sonar Fixes policy/models, removing model-yaml Change-Id: Icd82ea1aef90e4d638b13958519aac5ed5a53f73 Issue-ID: POLICY-2714 Signed-off-by: uj426b --- .../test/java/org/onap/policy/models/dao/EntityTest.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'models-dao/src') diff --git a/models-dao/src/test/java/org/onap/policy/models/dao/EntityTest.java b/models-dao/src/test/java/org/onap/policy/models/dao/EntityTest.java index 433196421..040b76b9b 100644 --- a/models-dao/src/test/java/org/onap/policy/models/dao/EntityTest.java +++ b/models-dao/src/test/java/org/onap/policy/models/dao/EntityTest.java @@ -26,7 +26,6 @@ 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; @@ -184,13 +183,13 @@ public class EntityTest { 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)); @@ -205,12 +204,12 @@ public class EntityTest { Set 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)); @@ -221,7 +220,7 @@ public class EntityTest { 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)); @@ -243,7 +242,7 @@ public class EntityTest { 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)); -- cgit 1.2.3-korg