X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=generic-resource-api%2Fprovider%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fsdnc%2Fnorthbound%2FServiceTopologyOperationRPCTest.java;fp=generic-resource-api%2Fprovider%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fsdnc%2Fnorthbound%2FServiceTopologyOperationRPCTest.java;h=ee0bdb50e057d46079ec0fd2ab0fad42b40e52be;hb=7e2a79d09429101a16fa1011770651a1880afd74;hp=b4ce214a70d825fba97b970994235dc4dcf823c0;hpb=19b7e2d7d4e8c0f3fb7a68fc9240bd560b297ca2;p=sdnc%2Fnorthbound.git diff --git a/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/ServiceTopologyOperationRPCTest.java b/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/ServiceTopologyOperationRPCTest.java index b4ce214a..ee0bdb50 100644 --- a/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/ServiceTopologyOperationRPCTest.java +++ b/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/ServiceTopologyOperationRPCTest.java @@ -22,7 +22,6 @@ package org.onap.sdnc.northbound; import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static org.onap.sdnc.northbound.GenericResourceApiProvider.APP_NAME; @@ -40,8 +39,6 @@ import static org.onap.sdnc.northbound.util.MDSALUtil.serviceStatus; import static org.onap.sdnc.northbound.util.MDSALUtil.serviceTopologyOperationInput; import static org.onap.sdnc.northbound.util.MDSALUtil.serviceTopologyOperationOutput; -import javax.xml.crypto.Data; -import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -60,8 +57,6 @@ 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.service.information.ServiceInformation; import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.service.model.infrastructure.Service; import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.service.status.ServiceStatus; -import org.opendaylight.yangtools.yang.binding.DataObject; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.common.RpcResult; @@ -71,17 +66,14 @@ import org.opendaylight.yangtools.yang.common.RpcResult; @RunWith(MockitoJUnitRunner.class) public class ServiceTopologyOperationRPCTest extends GenericResourceApiProviderTest { - final String SVC_OPERATION = "service-topology-operation"; - @Before public void setUp() throws Exception { super.setUp(); svcClient.setScvOperation(SVC_OPERATION); } - /** * Verify ServiceTopologyOperation RPC executes a DG then produces the expected {@link * ServiceTopologyOperationOutput} and persisted the expected {@link Service} in the {@link DataBroker} @@ -122,18 +114,18 @@ public class ServiceTopologyOperationRPCTest extends GenericResourceApiProviderT } @Test - public void serviceTopologyOperation_should_fail_when_service_info_not_present() throws Exception { + public void should_fail_when_service_info_not_present() throws Exception { // create the ServiceTopologyOperationInput from the template ServiceTopologyOperationInput input = build( serviceTopologyOperationInput() .setSdncRequestHeader(build(sdncRequestHeader() - .setSvcRequestId("svc-request-id: xyz") - .setSvcAction(SvcAction.Assign) - )) - .setRequestInformation(build(requestInformation() - .setRequestId("request-id: xyz") - .setRequestAction(RequestInformation.RequestAction.CreateServiceInstance) - ))); + .setSvcRequestId("svc-request-id: xyz") + .setSvcAction(SvcAction.Assign) + )) + .setRequestInformation(build(requestInformation() + .setRequestId("request-id: xyz") + .setRequestAction(RequestInformation.RequestAction.CreateServiceInstance) + ))); //execute the mdsal exec ServiceTopologyOperationOutput output = exec( @@ -149,7 +141,7 @@ public class ServiceTopologyOperationRPCTest extends GenericResourceApiProviderT @Test - public void serviceTopologyOperation_should_fail_when_client_execution_failed() throws Exception { + public void should_fail_when_client_execution_failed() throws Exception { svcClient.mockHasGraph(true); svcClient.mockExecute(new RuntimeException("test exception")); @@ -168,7 +160,7 @@ public class ServiceTopologyOperationRPCTest extends GenericResourceApiProviderT } @Test - public void serviceTopologyOperation_should_fail_when_client_has_no_graph() throws Exception { + public void should_fail_when_client_has_no_graph() throws Exception { svcClient.mockHasGraph(false); ServiceTopologyOperationInput input = createSTOI(); @@ -187,7 +179,7 @@ public class ServiceTopologyOperationRPCTest extends GenericResourceApiProviderT @Test - public void serviceTopologyOperation_should_fail_when_failed_to_update_mdsal() throws Exception { + public void should_fail_when_failed_to_update_mdsal() throws Exception { svcClient.mockHasGraph(true); WriteTransaction mockWriteTransaction = mock(WriteTransaction.class); @@ -211,8 +203,6 @@ public class ServiceTopologyOperationRPCTest extends GenericResourceApiProviderT assertEquals("Y", output.getAckFinalIndicator()); } - - private ServiceTopologyOperationInput createSTOI() { return build(