added test case to TransactionTest.java 51/57451/5
authorSandeep J <sandeejh@in.ibm.com>
Wed, 25 Jul 2018 10:04:25 +0000 (15:34 +0530)
committerTakamune Cho <tc012c@att.com>
Thu, 26 Jul 2018 13:18:36 +0000 (13:18 +0000)
added test case to increase code coverage

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

index cb8f088..ab8cecd 100644 (file)
@@ -3,7 +3,9 @@
  * ONAP : APPC
  * ================================================================================
  * Copyright (C) 2018 Nokia Intellectual Property. All rights reserved.
- * =============================================================================
+ * ================================================================================
+ * Modifications Copyright (C) 2018 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
@@ -22,7 +24,7 @@ package org.onap.appc.flow.controller.data;
 
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
-
+import static org.junit.Assert.assertEquals;
 import java.util.ArrayList;
 import org.junit.Assert;
 import org.junit.Before;
@@ -209,5 +211,25 @@ public class TransactionTest {
 
         Assert.assertTrue(transaction.equals(other));
     }
+    
+    @Test
+    public void testHashCode()
+    {
+        transaction.setAction("some_action");
+        transaction.setActionLevel("some_action_level");
+        transaction.setExecutionRPC("some_execution_rpc");
+        transaction.setExecutionType("some_execution_type");
+        transaction.setExecutionModule("some_execution_module");
+        transaction.setExecutionEndPoint("some_execution_endpoint");
+        transaction.setState("some_state");
+        transaction.setStatus("some_status");
+        transaction.setStatusCode("some_status_code");
+        transaction.setPswd("some_pass");
+        transaction.setPayload("some_payload");
+        transaction.setTransactionId(133);
+        transaction.setuId("some_uid");
+        int hashcode= transaction.hashCode();
+        assertEquals(-955260883,hashcode);
+    }
 
 }
\ No newline at end of file