added test cases to TestRuntimeContext.java 45/57745/2
authorSandeep J <sandeejh@in.ibm.com>
Thu, 26 Jul 2018 18:42:44 +0000 (00:12 +0530)
committerTakamune Cho <tc012c@att.com>
Sun, 29 Jul 2018 21:24:37 +0000 (21:24 +0000)
to increase code coverage

Issue-ID: APPC-1086
Change-Id: Iaca5e351a38e37bd6310e191c3515d2d24789858
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/TestRuntimeContext.java

index 87c545e..008577f 100644 (file)
@@ -4,6 +4,8 @@
 * ================================================================================
 * Copyright 2018 TechMahindra
 *=================================================================================
+* 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
@@ -21,6 +23,8 @@ 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;
@@ -50,4 +54,39 @@ public class TestRuntimeContext {
     public void testToString_ContainsString() {
         assertTrue(runtimeContext.toString().contains("RuntimeContext{requestContext"));
     }
+    
+    @Test
+    public void testGetRequestContext() {
+        RequestContext requestContext= new RequestContext();
+        runtimeContext.setRequestContext(requestContext);
+        assertEquals(requestContext, runtimeContext.getRequestContext());
+    }
+    
+    @Test
+    public void testGetResponseContext() {
+        ResponseContext responseContext= new ResponseContext();
+        runtimeContext.setResponseContext(responseContext);
+        assertEquals(responseContext, runtimeContext.getResponseContext());
+    }
+    
+    @Test
+    public void testGetTimeStart() {
+        Instant instant= Instant.now();
+        runtimeContext.setTimeStart(instant);
+        assertEquals(instant, runtimeContext.getTimeStart());
+    }
+    
+    @Test
+    public void testGetVnfContext() {
+        VNFContext vnfContext= new VNFContext();
+        runtimeContext.setVnfContext(vnfContext);
+        assertEquals(vnfContext, runtimeContext.getVnfContext());
+    }
+    
+    @Test
+    public void testGetTransactionRecord() {
+        TransactionRecord transactionRecord= new TransactionRecord();
+        runtimeContext.setTransactionRecord(transactionRecord);
+        assertEquals(transactionRecord, runtimeContext.getTransactionRecord());
+    }
 }