X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=sdnc-a1-controller%2Fnorthbound%2Fgeneric-resource-api%2Fprovider%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fsdnc%2Fnorthbound%2FGetpathsegmentTopologyOperationRPCTest.java;fp=sdnc-a1-controller%2Fnorthbound%2Fgeneric-resource-api%2Fprovider%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fsdnc%2Fnorthbound%2FGetpathsegmentTopologyOperationRPCTest.java;h=0000000000000000000000000000000000000000;hb=6a24cde9bbcc101fca02204ca6f1c69ada049790;hp=06da74c6634d1f5313a631c7143bf8d25e5ea94e;hpb=22ca33237c833c90e3626bf1132e72282e207ea5;p=nonrtric.git diff --git a/sdnc-a1-controller/northbound/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/GetpathsegmentTopologyOperationRPCTest.java b/sdnc-a1-controller/northbound/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/GetpathsegmentTopologyOperationRPCTest.java deleted file mode 100644 index 06da74c6..00000000 --- a/sdnc-a1-controller/northbound/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/GetpathsegmentTopologyOperationRPCTest.java +++ /dev/null @@ -1,69 +0,0 @@ -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.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; -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()); - } - - @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()); - } - - @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()); - } -}