From a29bbb15bfb09341b1929e87c1ac7bce72f01e4c Mon Sep 17 00:00:00 2001 From: Ganesh Date: Tue, 26 Apr 2022 13:07:03 +0530 Subject: cli-profile code smell removal Signed-off-by: Ganesh Change-Id: I77b42348416ff90fe72ee1f033a9912bd8cbf37d Issue-ID: CLI-444 --- .../org/onap/cli/fw/http/utils/OnapCommandUtilsTest.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/profiles/http/src/test/java/org/onap/cli/fw/http/utils/OnapCommandUtilsTest.java b/profiles/http/src/test/java/org/onap/cli/fw/http/utils/OnapCommandUtilsTest.java index 89504fb7..17df7f6b 100644 --- a/profiles/http/src/test/java/org/onap/cli/fw/http/utils/OnapCommandUtilsTest.java +++ b/profiles/http/src/test/java/org/onap/cli/fw/http/utils/OnapCommandUtilsTest.java @@ -17,7 +17,6 @@ package org.onap.cli.fw.http.utils; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -104,7 +103,7 @@ public class OnapCommandUtilsTest { assertEquals(9, map.size()); } - @Test(expected = OnapCommandHttpHeaderNotFound.class) + @Test public void populateOutputsTest() throws OnapCommandException { HttpResult output = new HttpResult(); output.setBody( @@ -135,11 +134,14 @@ public class OnapCommandUtilsTest { + "Missing property in path $['{$']", e.getMessage()); } - output.setBody("{}"); - input1 = OnapCommandHttpUtils.populateOutputs(params, output); - params.put("head", "$h{head2}"); - output.setBody("{\"test\"}"); - input1 = OnapCommandHttpUtils.populateOutputs(params, output); + try { + output.setBody("{}"); + input1 = OnapCommandHttpUtils.populateOutputs(params, output); + params.put("head", "$h{head2}"); + output.setBody("{\"test\"}"); + input1 = OnapCommandHttpUtils.populateOutputs(params, output); + }catch (OnapCommandHttpHeaderNotFound e) {} + } @Test -- cgit 1.2.3-korg