aboutsummaryrefslogtreecommitdiffstats
path: root/appc-provider/appc-provider-bundle/src/test/java/org
diff options
context:
space:
mode:
authorvidhyasree <sn141y@att.com>2018-05-31 23:49:10 -0400
committerPatrick Brady <pb071s@att.com>2018-06-01 22:03:23 +0000
commit6f44e217b73e2eca6abd00ffabb67e1aa4fca237 (patch)
tree2a40546c099feb5ba68ee87d1bce2277404fdae9 /appc-provider/appc-provider-bundle/src/test/java/org
parentf52f019fc49a37a68c285af6d5d289f4322819f4 (diff)
ConfigScaleOut-Payload parameter to manadatory
Issue-ID: APPC-929 Change-Id: Ifd0b8f303dd77acbf37774f749b9063dc67e7620 Signed-off-by: vidhyasree <sn141y@att.com>
Diffstat (limited to 'appc-provider/appc-provider-bundle/src/test/java/org')
-rw-r--r--appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/lcm/service/ConfigScaleOutServiceTest.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/lcm/service/ConfigScaleOutServiceTest.java b/appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/lcm/service/ConfigScaleOutServiceTest.java
index e46bb91ba..bb5e953a0 100644
--- a/appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/lcm/service/ConfigScaleOutServiceTest.java
+++ b/appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/lcm/service/ConfigScaleOutServiceTest.java
@@ -30,6 +30,7 @@ import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.mockito.internal.util.reflection.Whitebox;
import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.appc.util.JsonUtil;
import org.opendaylight.yang.gen.v1.org.onap.appc.lcm.rev160108.*;
import org.opendaylight.yang.gen.v1.org.onap.appc.lcm.rev160108.action.identifiers.ActionIdentifiers;
import org.opendaylight.yang.gen.v1.org.onap.appc.lcm.rev160108.common.header.CommonHeader;
@@ -39,6 +40,8 @@ import org.onap.appc.executor.objects.LCMCommandStatus;
import org.onap.appc.requesthandler.objects.RequestHandlerOutput;
import org.onap.appc.requesthandler.objects.RequestHandlerInput;
+import java.util.Map;
+
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
@@ -56,6 +59,7 @@ public class ConfigScaleOutServiceTest {
private ConfigScaleOutService configscaleoutServiceAction;
@Before
public void setUp() throws Exception {
+
configscaleoutServiceAction = spy(new ConfigScaleOutService());
}
@@ -149,20 +153,23 @@ public class ConfigScaleOutServiceTest {
configscaleoutServiceAction.validate(mockCommonHeader, Action.ConfigScaleOut, mockAI, null);
Mockito.verify(configscaleoutServiceAction, times(1)).validateExcludedActIds(any(), any());
status = (Status) Whitebox.getInternalState(configscaleoutServiceAction, "status");
- Assert.assertTrue("Should skip Payload",true);
+ Assert.assertEquals("should return missing parameter",
+ Integer.valueOf(LCMCommandStatus.MISSING_MANDATORY_PARAMETER.getResponseCode()), status.getCode());
// test empty payload
Mockito.doReturn("").when(mockPayload).getValue();
configscaleoutServiceAction.validate(mockCommonHeader, Action.ConfigScaleOut, mockAI, mockPayload);
status = (Status) Whitebox.getInternalState(configscaleoutServiceAction, "status");
- Assert.assertTrue("Should skip Payload",true);
+ Assert.assertEquals("should return invalid parameter",
+ Integer.valueOf(LCMCommandStatus.INVALID_INPUT_PARAMETER.getResponseCode()), status.getCode());
// test space payload
Mockito.doReturn(" ").when(mockPayload).getValue();
configscaleoutServiceAction.validate(mockCommonHeader, Action.ConfigScaleOut, mockAI, mockPayload);
status = (Status) Whitebox.getInternalState(configscaleoutServiceAction, "status");
- Assert.assertTrue("Should skip Payload",true);
+ Assert.assertEquals("should return invalid parameter",
+ Integer.valueOf(LCMCommandStatus.INVALID_INPUT_PARAMETER.getResponseCode()), status.getCode());
}
}