added test case to TestRequestContext.java 03/57703/2
authorSandeep J <sandeejh@in.ibm.com>
Thu, 26 Jul 2018 13:33:38 +0000 (19:03 +0530)
committerTakamune Cho <tc012c@att.com>
Fri, 27 Jul 2018 13:10:45 +0000 (13:10 +0000)
to increase code-coverage

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

index 9aee8e1..6e54ae1 100644 (file)
@@ -4,6 +4,8 @@
 * ================================================================================
 * Copyright 2018 TechMahindra
 *=================================================================================
+* Modifications Copyright 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
@@ -53,6 +55,15 @@ public class TestRequestContext {
         Assert.assertTrue(requestContext.getAdditionalContext().containsKey("A"));
         Assert.assertTrue(requestContext.getAdditionalContext().containsValue("a"));
     }
+    
+    @Test
+    public void testAddKeyValueToAdditionalContext() {
+        String key="key1";
+        String value="value1";
+        requestContext.addKeyValueToAdditionalContext(key, value);
+        Map<String, String> additionalContext= requestContext.getAdditionalContext();
+        Assert.assertEquals("value1", additionalContext.get("key1"));
+    }
 
     @Test
     public void testGetPayload() {