From aa6cd2f6479141ff2a1534b1672825c0d6517b92 Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Fri, 27 Jul 2018 00:12:44 +0530 Subject: added test cases to TestRuntimeContext.java to increase code coverage Issue-ID: APPC-1086 Change-Id: Iaca5e351a38e37bd6310e191c3515d2d24789858 Signed-off-by: Sandeep J --- .../appc/domainmodel/lcm/TestRuntimeContext.java | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'appc-dispatcher/appc-dispatcher-common') diff --git a/appc-dispatcher/appc-dispatcher-common/domain-model-lib/src/test/java/org/onap/appc/domainmodel/lcm/TestRuntimeContext.java b/appc-dispatcher/appc-dispatcher-common/domain-model-lib/src/test/java/org/onap/appc/domainmodel/lcm/TestRuntimeContext.java index 87c545ee3..008577f81 100644 --- a/appc-dispatcher/appc-dispatcher-common/domain-model-lib/src/test/java/org/onap/appc/domainmodel/lcm/TestRuntimeContext.java +++ b/appc-dispatcher/appc-dispatcher-common/domain-model-lib/src/test/java/org/onap/appc/domainmodel/lcm/TestRuntimeContext.java @@ -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()); + } } -- cgit 1.2.3-korg