diff options
author | Sandeep J <sandeejh@in.ibm.com> | 2018-07-27 00:12:44 +0530 |
---|---|---|
committer | Takamune Cho <tc012c@att.com> | 2018-07-29 21:24:37 +0000 |
commit | aa6cd2f6479141ff2a1534b1672825c0d6517b92 (patch) | |
tree | 252f8a8ad697e4053d6f6864b041c44c6d4fa710 /appc-dispatcher | |
parent | c4b02b02a1f9183138c74e0727fc687b336ccd42 (diff) |
added test cases to TestRuntimeContext.java
to increase code coverage
Issue-ID: APPC-1086
Change-Id: Iaca5e351a38e37bd6310e191c3515d2d24789858
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'appc-dispatcher')
-rw-r--r-- | appc-dispatcher/appc-dispatcher-common/domain-model-lib/src/test/java/org/onap/appc/domainmodel/lcm/TestRuntimeContext.java | 39 |
1 files changed, 39 insertions, 0 deletions
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()); + } } |