New test case added for code coverage 61/93261/1
authorprakash.e <prakash.e@huawei.com>
Sat, 10 Aug 2019 20:08:50 +0000 (01:38 +0530)
committerprakash.e <prakash.e@huawei.com>
Sat, 10 Aug 2019 20:09:04 +0000 (01:39 +0530)
Test case added in GenericConfigurationTopologyOperation with
service-istance-id

Change-Id: I16c104de7156b10022b6589f49625ab95b2412bf
Issue-ID: SDNC-840
Signed-off-by: Prakash.E <prakash.e@huawei.com>
generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/GenericConfigurationTopologyOperationRPCTest.java

index 3962484..629b485 100644 (file)
@@ -13,6 +13,8 @@ import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.re
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GenericConfigurationTopologyOperationOutput;
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.request.information.RequestInformation;
 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.sdnc.request.header.SdncRequestHeader.SvcAction;
+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.configuration.information.ConfigurationInformationBuilder;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
 import static org.junit.Assert.assertEquals;
@@ -46,8 +48,19 @@ public class GenericConfigurationTopologyOperationRPCTest extends GenericResourc
         assertEquals("Y", output.getAckFinalIndicator());
     }
 
+    @Test
+    public void should_fail_when_valid_vnf_topology() throws Exception {
 
+        GenericConfigurationTopologyOperationInput input = build(GenericConfigurationTopologyOperationInput()
+                .setServiceInformation(new ServiceInformationBuilder().setServiceInstanceId("ServiceInsatnceId").build()));
 
-}
+        GenericConfigurationTopologyOperationOutput output =
+                exec(genericResourceApiProvider::genericConfigurationTopologyOperation, input, RpcResult::getResult);
 
+        assertEquals("404", output.getResponseCode());
+        assertEquals("invalid input, null or empty configuration-id or configuration-type", output.getResponseMessage());
+        assertEquals("Y", output.getAckFinalIndicator());
+    }
+
+}