aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprakash.e <prakash.e@huawei.com>2019-08-10 08:11:28 +0530
committerprakash.e <prakash.e@huawei.com>2019-08-10 08:11:46 +0530
commit586c6fa1deabea69e46da85619bc0b35b77d71d8 (patch)
tree1420a000b059a88680142ac6788ab8c5bfd83774
parent1c38dbabc0dcc9787e9d8eb1bce8b206f8941ac2 (diff)
Test case addition for code coverage
Added test case for PortMirrorTopologyOperation Change-Id: I36b7ecdb14d8fccaf8fcbdad79d16d0392cb81ba Issue-ID: SDNC-840 Signed-off-by: Prakash.E <prakash.e@huawei.com>
-rw-r--r--generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/PortMirrorTopologyOperationRPCTest.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/PortMirrorTopologyOperationRPCTest.java b/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/PortMirrorTopologyOperationRPCTest.java
new file mode 100644
index 00000000..dd3e5d90
--- /dev/null
+++ b/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/PortMirrorTopologyOperationRPCTest.java
@@ -0,0 +1,36 @@
+package org.onap.sdnc.northbound;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.PortMirrorTopologyOperationInput;
+import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.PortMirrorTopologyOperationOutput;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+import static org.junit.Assert.assertEquals;
+import static org.onap.sdnc.northbound.util.MDSALUtil.*;
+
+@RunWith(MockitoJUnitRunner.class)
+public class PortMirrorTopologyOperationRPCTest extends GenericResourceApiProviderTest {
+
+ private static final String SVC_OPERATION = "policy-update-notify-operation";
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ svcClient.setScvOperation(SVC_OPERATION);
+ }
+
+ @Test
+ public void should_fail_when_invalid_vnf_topology() throws Exception {
+
+ PortMirrorTopologyOperationInput input = build(PortMirrorTopologyOperationInput());
+
+ PortMirrorTopologyOperationOutput output =
+ exec(genericResourceApiProvider::portMirrorTopologyOperation, input, RpcResult::getResult);
+
+ assertEquals("404", output.getResponseCode());
+ assertEquals("invalid input, null or empty service-instance-id", output.getResponseMessage());
+ }
+}