From: prakash.e Date: Mon, 12 Aug 2019 05:23:52 +0000 (+0530) Subject: New test case added for SDNC code coverage X-Git-Tag: 1.6.2~2^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=sdnc%2Fnorthbound.git;a=commitdiff_plain;h=refs%2Fchanges%2F85%2F93285%2F1 New test case added for SDNC code coverage Added test case with ServiceInstanceID in GetpathsegmentTopologyOperation Change-Id: I8b612b255b1ad605ce3504e6a060247c7c08d80d Issue-ID: SDNC-840 Signed-off-by: Prakash.E --- 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 index e97df5d9..2e24204a 100644 --- 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 @@ -6,6 +6,8 @@ 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.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.service.information.ServiceInformationBuilder; +import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.onap.model.information.OnapModelInformationBuilder; import org.opendaylight.yangtools.yang.common.RpcResult; import static org.junit.Assert.assertEquals; @@ -34,4 +36,18 @@ public class GetpathsegmentTopologyOperationRPCTest extends GenericResourceApiPr assertEquals("invalid input, null or empty service-instance-id", output.getResponseMessage()); assertEquals("Y", output.getAckFinalIndicator()); } + + @Test + public void should_fail_when_valid_vnf_topology() throws Exception { + + GetpathsegmentTopologyOperationInput input = build(GetpathsegmentTopologyOperationInput() + .setServiceInformation(new ServiceInformationBuilder().setServiceInstanceId("ServiceInstanceID").build())); + + GetpathsegmentTopologyOperationOutput output = + exec(genericResourceApiProvider::getpathsegmentTopologyOperation, input, RpcResult::getResult); + + assertEquals("404", output.getResponseCode()); + assertEquals("invalid input, no model-uuid provided", output.getResponseMessage()); + assertEquals("Y", output.getAckFinalIndicator()); + } }