added test cases to TestTransactionRecord.java 79/57879/2
authorSandeep J <sandeejh@in.ibm.com>
Fri, 27 Jul 2018 15:18:29 +0000 (20:48 +0530)
committerTakamune Cho <tc012c@att.com>
Sun, 29 Jul 2018 21:24:09 +0000 (21:24 +0000)
to increase code coverage

Issue-ID: APPC-1086
Change-Id: Ib1327bea47d5feb6fa7d5a2ad5bdb136642661b1
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
appc-dispatcher/appc-dispatcher-common/domain-model-lib/src/test/java/org/onap/appc/domainmodel/lcm/TestTransactionRecord.java

index b39c514..ff238f8 100644 (file)
@@ -4,6 +4,8 @@
 * ================================================================================
 * Copyright 2018 TechMahindra
 *=================================================================================
+* Modifications Copyright 2018 TechMahindra
+*=================================================================================
 * 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
@@ -20,6 +22,9 @@
 package org.onap.appc.domainmodel.lcm;
 
 import static org.junit.Assert.*;
+
+import java.time.Instant;
+
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -127,4 +132,40 @@ public class TestTransactionRecord {
     public void testToString_ContainsString() {
         assertTrue(transactionRecord.toString().contains("TransactionRecord{transactionId"));
     }
+    
+    @Test
+    public void testGetOriginTimeStamp() {
+        Instant instant= Instant.now();
+        transactionRecord.setOriginTimestamp(instant);
+        assertEquals(instant, transactionRecord.getOriginTimestamp());
+    }
+    
+    @Test
+    public void testGetStartTime() {
+        Instant instant= Instant.now();
+        transactionRecord.setStartTime(instant);
+        assertEquals(instant, transactionRecord.getStartTime());
+    }
+    
+    @Test
+    public void testGetEndTime() {
+        Instant instant= Instant.now();
+        transactionRecord.setEndTime(instant);
+        assertEquals(instant, transactionRecord.getEndTime());
+    }
+    
+    @Test
+    public void testGetOperation() {
+        VNFOperation vnfOperation= VNFOperation.ActionStatus;
+        transactionRecord.setOperation(vnfOperation);
+        assertEquals(vnfOperation, transactionRecord.getOperation());
+    }
+    
+    @Test
+    public void testGetMode() {
+        Flags.Mode mode= Flags.Mode.EXCLUSIVE;
+        transactionRecord.setMode(mode);
+        assertEquals("EXCLUSIVE", transactionRecord.getMode());
+    }
+    
 }