summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprakash.e <prakash.e@huawei.com>2019-08-10 07:13:30 +0530
committerprakash eswaramoorthy <prakash.e@huawei.com>2019-08-10 01:50:52 +0000
commit890e15ea07a855ca83a35009bc25bc967ea38f49 (patch)
treebe16c0a9bd4ea3c66f837f32fd0e59239732bcd0
parent1c38dbabc0dcc9787e9d8eb1bce8b206f8941ac2 (diff)
Test case addition for code coverage
Added test case for GetpathsegmentTopologyOperation Change-Id: I0dffcf5663aa14b63604a71e969b1f0aa7f9f1ce 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/GetpathsegmentTopologyOperationRPCTest.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/GetpathsegmentTopologyOperationRPCTest.java b/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/GetpathsegmentTopologyOperationRPCTest.java
new file mode 100644
index 00000000..e97df5d9
--- /dev/null
+++ b/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/GetpathsegmentTopologyOperationRPCTest.java
@@ -0,0 +1,37 @@
+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.GetpathsegmentTopologyOperationInput;
+import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GetpathsegmentTopologyOperationOutput;
+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 GetpathsegmentTopologyOperationRPCTest extends GenericResourceApiProviderTest {
+
+ private static final String SVC_OPERATION = "getpathsegment-topology-operation";
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ svcClient.setScvOperation(SVC_OPERATION);
+ }
+
+ @Test
+ public void should_fail_when_invalid_vnf_topology() throws Exception {
+
+ GetpathsegmentTopologyOperationInput input = build(GetpathsegmentTopologyOperationInput());
+
+ GetpathsegmentTopologyOperationOutput output =
+ exec(genericResourceApiProvider::getpathsegmentTopologyOperation, input, RpcResult::getResult);
+
+ assertEquals("404", output.getResponseCode());
+ assertEquals("invalid input, null or empty service-instance-id", output.getResponseMessage());
+ assertEquals("Y", output.getAckFinalIndicator());
+ }
+}