added test case to TestLCMCommandStatus.java 95/57695/2
authorSandeep J <sandeejh@in.ibm.com>
Thu, 26 Jul 2018 11:55:23 +0000 (17:25 +0530)
committerPatrick Brady <pb071s@att.com>
Fri, 27 Jul 2018 22:14:47 +0000 (22:14 +0000)
addes test case to increase code-coverage

Issue-ID: APPC-1086
Change-Id: Ie36b332e947900990d62a11723070a5ae8e53a99
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
appc-dispatcher/appc-command-executor/appc-command-executor-api/src/test/java/org/onap/appc/executor/objects/TestLCMCommandStatus.java

index 04c8a69..f778357 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
@@ -21,6 +23,9 @@ package org.onap.appc.executor.objects;
 
 import static org.junit.Assert.*;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import org.junit.Test;
 
 public class TestLCMCommandStatus {
@@ -59,4 +64,17 @@ public class TestLCMCommandStatus {
     public void testTostring() {
         assertTrue(accepted.toString().contains(accepted.name()));
     }
+    
+    @Test
+    public void testGetFormattedMessageWithCode() {
+        Params params= new Params();
+        Map<String, java.lang.Object> map = new HashMap<String, java.lang.Object>();
+        map.put("testKey1", "testValue1");
+        map.put("testKey2", "testValue2");
+        params.setParams(map);
+        String response=accepted.getFormattedMessageWithCode(params);
+        String expected="100-ACCEPTED - request accepted";
+        assertEquals(expected, response);
+    }
+    
 }
\ No newline at end of file