From 3d372e317bff5fe7e27296cab4ed76e759f86994 Mon Sep 17 00:00:00 2001 From: Rashmi Pujar Date: Tue, 5 Nov 2019 17:10:00 -0500 Subject: Use lombok annotations for objects in models-interaction/models-impl module Issue-ID: POLICY-1896 Signed-off-by: Rashmi Pujar Change-Id: I425afe25876cea91908391418582ef584e6fe6fc --- .../org/onap/policy/aai/AaiGetVnfResponseTest.java | 12 +++++---- .../java/org/onap/policy/aai/PnfInstanceTest.java | 29 +++++++++++----------- .../src/test/java/org/onap/policy/aai/PnfTest.java | 19 +++++++------- 3 files changed, 30 insertions(+), 30 deletions(-) (limited to 'models-interactions/model-impl/aai/src/test/java') diff --git a/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVnfResponseTest.java b/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVnfResponseTest.java index d74308d26..47ee5ba6f 100644 --- a/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVnfResponseTest.java +++ b/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/AaiGetVnfResponseTest.java @@ -22,7 +22,9 @@ package org.onap.policy.aai; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import java.io.File; import java.nio.file.Files; @@ -47,8 +49,8 @@ public class AaiGetVnfResponseTest { assertEquals("vLoadBalancerMS-Vnf-0809-2", resp.getVnfName()); assertEquals("vLoadBalancerMS/vLoadBalancerMS 0", resp.getVnfType()); assertEquals("1533850960381", resp.getResourceVersion()); - assertEquals(false, resp.getInMaint()); - assertEquals(true, resp.getIsClosedLoopDisabled()); + assertFalse(resp.isInMaint()); + assertTrue(resp.isClosedLoopDisabled()); assertEquals("53638a85-361a-437d-8830-4b0d5329225e", resp.getModelInvariantId()); assertEquals("PROV", resp.getProvStatus()); assertEquals("Active", resp.getOrchestrationStatus()); @@ -71,7 +73,7 @@ public class AaiGetVnfResponseTest { relationshipList = new RelationshipList(); resp.setInMaint(true); - resp.setIsClosedLoopDisabled(false); + resp.setClosedLoopDisabled(false); resp.setModelInvariantId("modiv"); resp.setOrchestrationStatus("orch"); resp.setProvStatus("mystatus"); @@ -86,8 +88,8 @@ public class AaiGetVnfResponseTest { assertEquals("vnfname", resp.getVnfName()); assertEquals("vnftype", resp.getVnfType()); assertEquals("vers", resp.getResourceVersion()); - assertEquals(true, resp.getInMaint()); - assertEquals(false, resp.getIsClosedLoopDisabled()); + assertTrue(resp.isInMaint()); + assertFalse(resp.isClosedLoopDisabled()); assertEquals("modiv", resp.getModelInvariantId()); assertEquals("mystatus", resp.getProvStatus()); assertEquals("orch", resp.getOrchestrationStatus()); diff --git a/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/PnfInstanceTest.java b/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/PnfInstanceTest.java index 8cf839110..db3e90ed0 100644 --- a/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/PnfInstanceTest.java +++ b/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/PnfInstanceTest.java @@ -56,8 +56,7 @@ public class PnfInstanceTest { assertEquals(PnfType.ENODEB, pnfInstanceClone.getPnfType()); assertEquals("pnf-serial-test", pnfInstanceClone.getPnfSerial()); - assertEquals("PNFInstance [PNFName=pnf-name-test, PNFInstanceName=pnf-instance-name-test, PNFType=eNodeB, " - + "PNFSerial=pnf-serial-test]", pnfInstanceClone.toString()); + assertNotNull(pnfInstanceClone.toString()); assertNotEquals(0, pnfInstanceClone.hashCode()); assertNotEquals(0, new Pnf().hashCode()); @@ -79,19 +78,19 @@ public class PnfInstanceTest { PnfInstance pnfInstanceOther5 = new PnfInstance(pnfInstance); pnfInstanceOther5.setPnfSerial("pnf-serial-test-diff"); - assertTrue(pnfInstance.equals(pnfInstance)); - assertFalse(pnfInstance.equals(null)); - assertFalse(pnfInstance.equals("hello")); - assertTrue(pnfInstance.equals(pnfInstanceClone)); - assertFalse(pnfInstance.equals(new Pnf())); - assertFalse(new Pnf().equals(pnfInstance)); - assertFalse(new Pnf().equals(pnfInstanceOther0)); - assertFalse(pnfInstanceOther0.equals(pnfInstance)); - assertFalse(pnfInstanceOther1.equals(pnfInstance)); - assertFalse(pnfInstanceOther2.equals(pnfInstance)); - assertFalse(pnfInstanceOther3.equals(pnfInstance)); - assertFalse(pnfInstanceOther4.equals(pnfInstance)); - assertFalse(pnfInstanceOther5.equals(pnfInstance)); + assertEquals(pnfInstance, pnfInstance); + assertNotEquals(null, pnfInstance); + assertNotEquals("hello", pnfInstance); + assertEquals(pnfInstance, pnfInstanceClone); + assertNotEquals(pnfInstance, new Pnf()); + assertNotEquals(new Pnf(), pnfInstance); + assertNotEquals(new Pnf(), pnfInstanceOther0); + assertNotEquals(pnfInstanceOther0, pnfInstance); + assertNotEquals(pnfInstanceOther1, pnfInstance); + assertNotEquals(pnfInstanceOther2, pnfInstance); + assertNotEquals(pnfInstanceOther3, pnfInstance); + assertNotEquals(pnfInstanceOther4, pnfInstance); + assertNotEquals(pnfInstanceOther5, pnfInstance); logger.info(Serialization.gsonPretty.toJson(pnfInstance)); } diff --git a/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/PnfTest.java b/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/PnfTest.java index 54cf4735b..d7fc0d2b7 100644 --- a/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/PnfTest.java +++ b/models-interactions/model-impl/aai/src/test/java/org/onap/policy/aai/PnfTest.java @@ -49,23 +49,22 @@ public class PnfTest { assertEquals(PNF_NAME_TEST, pnfClone.getPnfName()); assertEquals(PnfType.ENODEB, pnfClone.getPnfType()); - assertEquals("PNF [PNFName=pnf-name-test, PNFType=eNodeB]", pnfClone.toString()); + assertNotNull(pnfClone.toString()); assertNotEquals(0, pnfClone.hashCode()); assertNotEquals(0, new Pnf().hashCode()); Pnf pnfOther = new Pnf(); pnfOther.setPnfName(PNF_NAME_TEST); - assertTrue(pnf.equals(pnf)); - assertFalse(pnf.equals(null)); - assertFalse(pnf.equals("hello")); - assertTrue(pnf.equals(pnfClone)); - assertFalse(pnf.equals(new Pnf())); - assertFalse(new Pnf().equals(pnf)); - assertFalse(new Pnf().equals(pnfOther)); - assertFalse(pnfOther.equals(pnf)); + assertEquals(pnf, pnf); + assertNotNull(pnf); + assertNotEquals("hello", pnf); + assertEquals(pnf, pnfClone); + assertNotEquals(pnf, new Pnf()); + assertNotEquals(new Pnf(), pnf); + assertNotEquals(new Pnf(), pnfOther); + assertNotEquals(pnfOther, pnf); logger.info(Serialization.gsonPretty.toJson(pnf)); } - } -- cgit 1.2.3-korg