From 01b9bff05de587dcc3e265972966cc14ee7a9c98 Mon Sep 17 00:00:00 2001 From: "prakash.e" Date: Tue, 13 Aug 2019 16:39:27 +0530 Subject: [PATCH] Test case added for code coverage Added test case with valid ServiceInstanceID in GetpathsegmentTopologyOperation Change-Id: I6e647d8b19ad986427ad3642926ee1d12de3ab25 Issue-ID: SDNC-840 Signed-off-by: Prakash.E --- .../GetpathsegmentTopologyOperationRPCTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 2e24204a..06da74c6 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 @@ -50,4 +50,20 @@ public class GetpathsegmentTopologyOperationRPCTest extends GenericResourceApiPr assertEquals("invalid input, no model-uuid provided", output.getResponseMessage()); assertEquals("Y", output.getAckFinalIndicator()); } + + @Test + public void should_fail_when_valid_serice_excep_vnf_topology() throws Exception { + + GetpathsegmentTopologyOperationInput input = build(GetpathsegmentTopologyOperationInput() + .setServiceInformation(new ServiceInformationBuilder().setServiceInstanceId("ServiceInstanceID") + .setOnapModelInformation(new OnapModelInformationBuilder().setModelUuid("moduleUUID").build()).build())); + + GetpathsegmentTopologyOperationOutput output = + exec(genericResourceApiProvider::getpathsegmentTopologyOperation, input, RpcResult::getResult); + + assertEquals("503", output.getResponseCode()); + assertEquals("No service logic active for generic-resource-api: 'getpathsegment-topology-operation'", + output.getResponseMessage()); + assertEquals("Y", output.getAckFinalIndicator()); + } } -- 2.16.6