From: Dan Timoney Date: Sat, 10 Aug 2019 23:09:38 +0000 (+0000) Subject: Merge "Test case addition for code coverage" X-Git-Tag: 1.6.2~7 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=sdnc%2Fnorthbound.git;a=commitdiff_plain;h=f3ce37cb044d2ea93f3cc5e73d9afd5d9f9b5554;hp=4b7431b5d45cd50ee6331fd7dc72f7db73b587e5 Merge "Test case addition for code coverage" --- 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()); + } +}