aboutsummaryrefslogtreecommitdiffstats
path: root/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/VnfTopologyOperationRPCTest.java
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2022-08-03 11:59:43 -0400
committerDan Timoney <dtimoney@att.com>2022-08-05 16:10:18 -0400
commit219b28ed3c3ee23f10d67c9c50583a8bd5a84f3a (patch)
treee3d5654f7cb1c16d899d652ab25c97992bf635b6 /generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/VnfTopologyOperationRPCTest.java
parent2b1dc5b10650ed62f71d4b84ef662b59ed663fc1 (diff)
Changes to support ODL Sulfur update
Changes to sdnc/northbound to conform to changes in OpenDaylight Sulfur release. Many of these changes are due to a change in yangtools, which no longer implements a common ancestor for its builder classes. This broke a utility method used in jUnit test cases (build()), which meant all jUnits using that method had to be updated to call each individual builder's build() method directly. Issue-ID: CCSDK-1728 Signed-off-by: Dan Timoney <dtimoney@att.com> Change-Id: Ia82aa3decd82d873120dd643a6a0427928890f99
Diffstat (limited to 'generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/VnfTopologyOperationRPCTest.java')
-rw-r--r--generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/VnfTopologyOperationRPCTest.java90
1 files changed, 42 insertions, 48 deletions
diff --git a/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/VnfTopologyOperationRPCTest.java b/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/VnfTopologyOperationRPCTest.java
index c1564c39..cc5e8975 100644
--- a/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/VnfTopologyOperationRPCTest.java
+++ b/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/VnfTopologyOperationRPCTest.java
@@ -6,7 +6,6 @@ import static org.mockito.Mockito.when;
import static org.onap.sdnc.northbound.GenericResourceApiProvider.APP_NAME;
import static org.onap.sdnc.northbound.GenericResourceApiProvider.NO_SERVICE_LOGIC_ACTIVE;
import static org.onap.sdnc.northbound.GenericResourceApiProvider.NULL_OR_EMPTY_ERROR_PARAM;
-import static org.onap.sdnc.northbound.util.MDSALUtil.build;
import static org.onap.sdnc.northbound.util.MDSALUtil.exec;
import static org.onap.sdnc.northbound.util.MDSALUtil.requestInformation;
import static org.onap.sdnc.northbound.util.MDSALUtil.sdncRequestHeader;
@@ -46,7 +45,7 @@ public class VnfTopologyOperationRPCTest extends GenericResourceApiProviderTest
@Test
public void should_fail_when_service_info_not_present() throws Exception {
- VnfTopologyOperationInput input = build(vnfTopologyOperationInput());
+ VnfTopologyOperationInput input = vnfTopologyOperationInput().build();
VnfTopologyOperationOutput output =
exec(genericResourceApiProvider::vnfTopologyOperation, input, RpcResult::getResult);
@@ -82,14 +81,13 @@ public class VnfTopologyOperationRPCTest extends GenericResourceApiProviderTest
svcClient.mockHasGraph(true);
svcClient.mockExecute(new RuntimeException("test exception"));
- VnfTopologyOperationInput input = build(vnfTopologyOperationInput()
- .setServiceInformation(build(serviceInformationBuilder()
- .setServiceInstanceId("test-service-instance-id")
- ))
- .setVnfInformation(build(vnfInformationBuilder()
- .setVnfId("test-vnf-id")
- ))
- );
+ VnfTopologyOperationInput input = vnfTopologyOperationInput()
+ .setServiceInformation(serviceInformationBuilder()
+ .setServiceInstanceId("test-service-instance-id").build()
+ )
+ .setVnfInformation(vnfInformationBuilder()
+ .setVnfId("test-vnf-id").build()
+ ).build();
VnfTopologyOperationOutput output =
exec(genericResourceApiProvider::vnfTopologyOperation, input, RpcResult::getResult);
@@ -104,14 +102,13 @@ public class VnfTopologyOperationRPCTest extends GenericResourceApiProviderTest
svcClient.mockHasGraph(false);
- VnfTopologyOperationInput input = build(vnfTopologyOperationInput()
- .setServiceInformation(build(serviceInformationBuilder()
- .setServiceInstanceId("test-service-instance-id")
- ))
- .setVnfInformation(build(vnfInformationBuilder()
- .setVnfId("test-vnf-id")
- ))
- );
+ VnfTopologyOperationInput input = vnfTopologyOperationInput()
+ .setServiceInformation(serviceInformationBuilder()
+ .setServiceInstanceId("test-service-instance-id").build()
+ )
+ .setVnfInformation(vnfInformationBuilder()
+ .setVnfId("test-vnf-id").build()
+ ).build();
VnfTopologyOperationOutput output =
exec(genericResourceApiProvider::vnfTopologyOperation, input, RpcResult::getResult);
@@ -134,14 +131,13 @@ public class VnfTopologyOperationRPCTest extends GenericResourceApiProviderTest
when(spyDataBroker.newWriteOnlyTransaction()).thenReturn(mockWriteTransaction);
genericResourceApiProvider.setDataBroker(spyDataBroker);
- VnfTopologyOperationInput input = build(vnfTopologyOperationInput()
- .setServiceInformation(build(serviceInformationBuilder()
- .setServiceInstanceId("test-service-instance-id")
- ))
- .setVnfInformation(build(vnfInformationBuilder()
- .setVnfId("test-vnf-id")
- ))
- );
+ VnfTopologyOperationInput input = vnfTopologyOperationInput()
+ .setServiceInformation(serviceInformationBuilder()
+ .setServiceInstanceId("test-service-instance-id").build()
+ )
+ .setVnfInformation(vnfInformationBuilder()
+ .setVnfId("test-vnf-id").build()
+ ).build();
VnfTopologyOperationOutput output =
exec(genericResourceApiProvider::vnfTopologyOperation, input, RpcResult::getResult);
@@ -158,22 +154,21 @@ public class VnfTopologyOperationRPCTest extends GenericResourceApiProviderTest
PropBuilder svcResultProp = svcClient.createExecuteOKResult();
svcClient.mockExecute(svcResultProp);
- VnfTopologyOperationInput input = build(vnfTopologyOperationInput()
- .setSdncRequestHeader(build(sdncRequestHeader()
+ VnfTopologyOperationInput input = vnfTopologyOperationInput()
+ .setSdncRequestHeader(sdncRequestHeader()
.setSvcRequestId("test-svc-request-id")
- .setSvcAction(SvcAction.Assign)
- ))
- .setRequestInformation(build(requestInformation()
+ .setSvcAction(SvcAction.Assign).build()
+ )
+ .setRequestInformation(requestInformation()
.setRequestId("test-request-id")
- .setRequestAction(RequestInformation.RequestAction.CreateServiceInstance)
- ))
- .setServiceInformation(build(serviceInformationBuilder()
- .setServiceInstanceId("test-service-instance-id")
- ))
- .setVnfInformation(build(vnfInformationBuilder()
- .setVnfId("test-vnf-id")
- ))
- );
+ .setRequestAction(RequestInformation.RequestAction.CreateServiceInstance).build()
+ )
+ .setServiceInformation(serviceInformationBuilder()
+ .setServiceInstanceId("test-service-instance-id").build()
+ )
+ .setVnfInformation(vnfInformationBuilder()
+ .setVnfId("test-vnf-id").build()
+ ).build();
VnfTopologyOperationOutput output =
exec(genericResourceApiProvider::vnfTopologyOperation, input, RpcResult::getResult);
@@ -189,20 +184,19 @@ public class VnfTopologyOperationRPCTest extends GenericResourceApiProviderTest
private VnfTopologyOperationOutput createExpectedOutput(PropBuilder svcResultProp,
VnfTopologyOperationInput vnfTopologyOperationInput) {
- return build(
+ return
vnfTopologyOperationOutput()
.setSvcRequestId(vnfTopologyOperationInput.getSdncRequestHeader().getSvcRequestId())
.setResponseCode(svcResultProp.get(svcClient.errorCode))
.setAckFinalIndicator(svcResultProp.get(svcClient.ackFinal))
.setResponseMessage(svcResultProp.get(svcClient.errorMessage))
- .setServiceResponseInformation(build(serviceResponseInformation()
+ .setServiceResponseInformation(serviceResponseInformation()
.setInstanceId(vnfTopologyOperationInput.getServiceInformation().getServiceInstanceId())
- .setObjectPath(svcResultProp.get(svcClient.serviceObjectPath))
- ))
- .setVnfResponseInformation(build(vnfResponseInformation()
+ .setObjectPath(svcResultProp.get(svcClient.serviceObjectPath)).build()
+ )
+ .setVnfResponseInformation(vnfResponseInformation()
.setInstanceId(vnfTopologyOperationInput.getVnfInformation().getVnfId())
- .setObjectPath(svcResultProp.get(svcClient.vnfObjectPath))
- ))
- );
+ .setObjectPath(svcResultProp.get(svcClient.vnfObjectPath)).build()
+ ).build();
}
}