Test case addition for code coverage
[sdnc/northbound.git] / generic-resource-api / provider / src / test / java / org / onap / sdnc / northbound / GetpathsegmentTopologyOperationRPCTest.java
1 package org.onap.sdnc.northbound;
2
3 import org.junit.Before;
4 import org.junit.Test;
5 import org.junit.runner.RunWith;
6 import org.mockito.runners.MockitoJUnitRunner;
7 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GetpathsegmentTopologyOperationInput;
8 import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.GetpathsegmentTopologyOperationOutput;
9 import org.opendaylight.yangtools.yang.common.RpcResult;
10
11 import static org.junit.Assert.assertEquals;
12 import static org.onap.sdnc.northbound.util.MDSALUtil.*;
13
14 @RunWith(MockitoJUnitRunner.class)
15 public class GetpathsegmentTopologyOperationRPCTest extends GenericResourceApiProviderTest {
16
17     private static final String SVC_OPERATION = "getpathsegment-topology-operation";
18
19     @Before
20     public void setUp() throws Exception {
21         super.setUp();
22         svcClient.setScvOperation(SVC_OPERATION);
23     }
24
25     @Test
26     public void should_fail_when_invalid_vnf_topology() throws Exception {
27
28         GetpathsegmentTopologyOperationInput input = build(GetpathsegmentTopologyOperationInput());
29
30         GetpathsegmentTopologyOperationOutput output =
31                 exec(genericResourceApiProvider::getpathsegmentTopologyOperation, input, RpcResult::getResult);
32
33         assertEquals("404", output.getResponseCode());
34         assertEquals("invalid input, null or empty service-instance-id", output.getResponseMessage());
35         assertEquals("Y", output.getAckFinalIndicator());
36     }
37 }