made changes to existing test case 82/75882/7
authorSandeep J <sandeejh@in.ibm.com>
Wed, 16 Jan 2019 15:58:31 +0000 (21:28 +0530)
committerTakamune Cho <takamune.cho@att.com>
Fri, 18 Jan 2019 15:41:52 +0000 (15:41 +0000)
to increase code coverage

Issue-ID: APPC-1086
Change-Id: I521d6770ee383d78a005bd9ce8c77c6682e14678
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/data/ActionIdentifierTest.java

index 220e791..cc0ed3d 100644 (file)
@@ -1,91 +1,98 @@
-/*-\r
- * ============LICENSE_START=======================================================\r
- * ONAP : APPC\r
- * ================================================================================\r
- * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.\r
- * =============================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *\r
- * ============LICENSE_END=========================================================\r
- */\r
-\r
-package org.onap.appc.flow.controller.data;\r
-\r
-import static org.junit.Assert.assertTrue;\r
-import static org.junit.Assert.assertFalse;\r
-import static org.junit.Assert.assertEquals;\r
-import org.junit.Test;\r
-\r
-public class ActionIdentifierTest {\r
-\r
-    @Test\r
-    public void testHashCode() {\r
-        ActionIdentifier actionId1 = new ActionIdentifier();\r
-        ActionIdentifier actionId2 = new ActionIdentifier();\r
-        assertTrue(actionId1.hashCode() == actionId2.hashCode());\r
-\r
-        if (actionId1.equals(actionId2)) {\r
-            assertTrue(actionId1.hashCode() == actionId2.hashCode());\r
-        }\r
-\r
-        actionId2.setVnfcName("vnfcName");\r
-        assertFalse(actionId1.hashCode() == actionId2.hashCode());\r
-\r
-        actionId2.setVnfcName("");\r
-        assertTrue(actionId1.hashCode() == actionId2.hashCode());\r
-\r
-        actionId2.setVnfId("vnfId");\r
-        assertFalse(actionId1.hashCode() == actionId2.hashCode());\r
-\r
-        actionId2.setVnfId("");\r
-        assertTrue(actionId1.hashCode() == actionId2.hashCode());\r
-\r
-        actionId2.setVserverId("vserverId");\r
-        assertFalse(actionId1.hashCode() == actionId2.hashCode());\r
-\r
-        actionId2.setVserverId("");\r
-        assertTrue(actionId1.hashCode() == actionId2.hashCode());\r
-    }\r
-\r
-    @Test\r
-    public void testEquals() {\r
-        ActionIdentifier actionId1 = new ActionIdentifier();\r
-        ActionIdentifier actionId2 = new ActionIdentifier();\r
-\r
-        assertTrue(actionId1.equals(actionId2) && actionId2.equals(actionId1));\r
-        assertTrue(actionId1.equals(actionId1));\r
-        assertFalse(actionId1.equals(null));\r
-    }\r
-\r
-    @Test\r
-    public void testSettersAndGetters() {\r
-        ActionIdentifier actionId = new ActionIdentifier();\r
-        actionId.setVserverId("vserverId");\r
-        assertEquals("vserverId", actionId.getVserverId());\r
-\r
-        actionId.setVnfcName("vnfcName");\r
-        assertEquals("vnfcName", actionId.getVnfcName());\r
-\r
-        actionId.setVnfId("vnfId");\r
-        assertEquals("vnfId", actionId.getVnfId());\r
-    }\r
-\r
-    @Test\r
-    public void testtoString() {\r
-        ActionIdentifier actionId = new ActionIdentifier();\r
-        actionId.setVnfcName("vnfcName");\r
-        String ret = actionId.toString();\r
-        assertFalse("toString is not empty", ret.isEmpty());\r
-    }\r
-\r
-}\r
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+ * =============================================================================
+ * Modifications Copyright (C) 2018-2019 IBM.
+ * =============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.appc.flow.controller.data;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertEquals;
+import org.junit.Test;
+
+public class ActionIdentifierTest {
+
+    @Test
+    public void testHashCode() {
+        ActionIdentifier actionId1 = new ActionIdentifier();
+        ActionIdentifier actionId2 = new ActionIdentifier();
+        assertTrue(actionId1.hashCode() == actionId2.hashCode());
+
+        if (actionId1.equals(actionId2)) {
+            assertTrue(actionId1.hashCode() == actionId2.hashCode());
+        }
+
+        actionId2.setVnfcName("vnfcName");
+        assertFalse(actionId1.hashCode() == actionId2.hashCode());
+
+        actionId2.setVnfcName("");
+        assertTrue(actionId1.hashCode() == actionId2.hashCode());
+
+        actionId2.setVnfId("vnfId");
+        assertFalse(actionId1.hashCode() == actionId2.hashCode());
+
+        actionId2.setVnfId("");
+        assertTrue(actionId1.hashCode() == actionId2.hashCode());
+
+        actionId2.setVserverId("vserverId");
+        assertFalse(actionId1.hashCode() == actionId2.hashCode());
+
+        actionId2.setVserverId("");
+        assertTrue(actionId1.hashCode() == actionId2.hashCode());
+    }
+
+    @Test
+    public void testEquals() {
+        ActionIdentifier actionId1 = new ActionIdentifier();
+        ActionIdentifier actionId2 = new ActionIdentifier();
+        
+        actionId1.setVnfcName("vnfcName");
+        actionId1.setVnfId("vnfId");
+        actionId1.setVserverId("vserverId");
+        actionId2.setVnfcName("vnfcName");
+        actionId2.setVnfId("vnfId");
+        actionId2.setVserverId("vserverId");
+        assertEquals(actionId1,actionId2);
+        assertEquals(actionId2,actionId1);
+    }
+
+    @Test
+    public void testSettersAndGetters() {
+        ActionIdentifier actionId = new ActionIdentifier();
+        actionId.setVserverId("vserverId");
+        assertEquals("vserverId", actionId.getVserverId());
+
+        actionId.setVnfcName("vnfcName");
+        assertEquals("vnfcName", actionId.getVnfcName());
+
+        actionId.setVnfId("vnfId");
+        assertEquals("vnfId", actionId.getVnfId());
+    }
+
+    @Test
+    public void testtoString() {
+        ActionIdentifier actionId = new ActionIdentifier();
+        actionId.setVnfcName("vnfcName");
+        String ret = actionId.toString();
+        assertFalse("toString is not empty", ret.isEmpty());
+    }
+
+}