summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-07-27 20:48:29 +0530
committerTakamune Cho <tc012c@att.com>2018-07-29 21:24:09 +0000
commitc4b02b02a1f9183138c74e0727fc687b336ccd42 (patch)
tree8e70f586fe2d2c88e351684931309e5c5b5f578d
parent843052225ac96b88a306d1ec32af3ec21b448138 (diff)
added test cases to TestTransactionRecord.java
to increase code coverage Issue-ID: APPC-1086 Change-Id: Ib1327bea47d5feb6fa7d5a2ad5bdb136642661b1 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
-rw-r--r--appc-dispatcher/appc-dispatcher-common/domain-model-lib/src/test/java/org/onap/appc/domainmodel/lcm/TestTransactionRecord.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/appc-dispatcher/appc-dispatcher-common/domain-model-lib/src/test/java/org/onap/appc/domainmodel/lcm/TestTransactionRecord.java b/appc-dispatcher/appc-dispatcher-common/domain-model-lib/src/test/java/org/onap/appc/domainmodel/lcm/TestTransactionRecord.java
index b39c51440..ff238f853 100644
--- a/appc-dispatcher/appc-dispatcher-common/domain-model-lib/src/test/java/org/onap/appc/domainmodel/lcm/TestTransactionRecord.java
+++ b/appc-dispatcher/appc-dispatcher-common/domain-model-lib/src/test/java/org/onap/appc/domainmodel/lcm/TestTransactionRecord.java
@@ -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());
+ }
+
}