diff options
author | Dan Timoney <dtimoney@att.com> | 2022-08-03 11:59:43 -0400 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2022-08-05 16:10:18 -0400 |
commit | 219b28ed3c3ee23f10d67c9c50583a8bd5a84f3a (patch) | |
tree | e3d5654f7cb1c16d899d652ab25c97992bf635b6 /generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/BrgTopologyOperationRPCTest.java | |
parent | 2b1dc5b10650ed62f71d4b84ef662b59ed663fc1 (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/BrgTopologyOperationRPCTest.java')
-rw-r--r-- | generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/BrgTopologyOperationRPCTest.java | 61 |
1 files changed, 26 insertions, 35 deletions
diff --git a/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/BrgTopologyOperationRPCTest.java b/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/BrgTopologyOperationRPCTest.java index ec00c363..35ffabab 100644 --- a/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/BrgTopologyOperationRPCTest.java +++ b/generic-resource-api/provider/src/test/java/org/onap/sdnc/northbound/BrgTopologyOperationRPCTest.java @@ -7,7 +7,6 @@ import static org.onap.sdnc.northbound.GenericResourceApiProvider.NULL_OR_EMPTY_ import static org.onap.sdnc.northbound.util.MDSALUtil.brgResponseInformation; import static org.onap.sdnc.northbound.util.MDSALUtil.brgTopologyOperationInput; import static org.onap.sdnc.northbound.util.MDSALUtil.brgTopologyOperationOutput; -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; @@ -40,8 +39,7 @@ public class BrgTopologyOperationRPCTest extends GenericResourceApiProviderTest @Test public void should_fail_when_service_instance_id_not_present() throws Exception { - BrgTopologyOperationInput input = build(brgTopologyOperationInput()); - + BrgTopologyOperationInput input =brgTopologyOperationInput().build(); BrgTopologyOperationOutput output = exec(genericResourceApiProvider::brgTopologyOperation, input, RpcResult::getResult); @@ -56,15 +54,13 @@ public class BrgTopologyOperationRPCTest extends GenericResourceApiProviderTest svcClient.mockHasGraph(true); svcClient.mockExecuteWoServiceData(new RuntimeException("test exception")); - BrgTopologyOperationInput input = build(brgTopologyOperationInput() - .setSdncRequestHeader(build(sdncRequestHeader() - .setSvcRequestId("test-svc-request-id") - .setSvcAction(SvcAction.Assign) - )) - .setServiceInformation(build(serviceInformationBuilder() - .setServiceInstanceId("test-service-instance-id") - )) - ); + BrgTopologyOperationInput input = brgTopologyOperationInput() + .setSdncRequestHeader(sdncRequestHeader() + .setSvcRequestId("test-svc-request-id") + .setSvcAction(SvcAction.Assign) + .build()) + .setServiceInformation(serviceInformationBuilder() + .setServiceInstanceId("test-service-instance-id").build()).build(); BrgTopologyOperationOutput output = exec(genericResourceApiProvider::brgTopologyOperation, input, RpcResult::getResult); @@ -79,15 +75,13 @@ public class BrgTopologyOperationRPCTest extends GenericResourceApiProviderTest svcClient.mockHasGraph(false); - BrgTopologyOperationInput input = build(brgTopologyOperationInput() - .setSdncRequestHeader(build(sdncRequestHeader() + BrgTopologyOperationInput input = brgTopologyOperationInput() + .setSdncRequestHeader(sdncRequestHeader() .setSvcRequestId("test-svc-request-id") - .setSvcAction(SvcAction.Assign) - )) - .setServiceInformation(build(serviceInformationBuilder() - .setServiceInstanceId("test-service-instance-id") - )) - ); + .setSvcAction(SvcAction.Assign).build()) + .setServiceInformation(serviceInformationBuilder() + .setServiceInstanceId("test-service-instance-id").build()) + .build(); BrgTopologyOperationOutput output = exec(genericResourceApiProvider::brgTopologyOperation, input, RpcResult::getResult); @@ -105,15 +99,13 @@ public class BrgTopologyOperationRPCTest extends GenericResourceApiProviderTest svcResultProp.set("security-zone-object-path", "securityZoneObjectPath: XYZ"); svcClient.mockExecuteWoServiceData(svcResultProp); - BrgTopologyOperationInput input = build(brgTopologyOperationInput() - .setRequestInformation(build(requestInformation() + BrgTopologyOperationInput input = brgTopologyOperationInput() + .setRequestInformation(requestInformation() .setRequestId("test-request-id") - .setRequestAction(RequestInformation.RequestAction.CreateServiceInstance) - )) - .setServiceInformation(build(serviceInformationBuilder() - .setServiceInstanceId("test-service-instance-id") - )) - ); + .setRequestAction(RequestInformation.RequestAction.CreateServiceInstance).build()) + .setServiceInformation(serviceInformationBuilder() + .setServiceInstanceId("test-service-instance-id").build()).build(); + BrgTopologyOperationOutput output = exec(genericResourceApiProvider::brgTopologyOperation, input, RpcResult::getResult); @@ -130,17 +122,16 @@ public class BrgTopologyOperationRPCTest extends GenericResourceApiProviderTest private BrgTopologyOperationOutput createExpectedOutput(PropBuilder propBuilder, BrgTopologyOperationInput input) { - return build(brgTopologyOperationOutput() - .setBrgResponseInformation(build(brgResponseInformation() - .setObjectPath(propBuilder.get("brg-object-path")))) + return brgTopologyOperationOutput() + .setBrgResponseInformation(brgResponseInformation() + .setObjectPath(propBuilder.get("brg-object-path")).build()) .setResponseCode(propBuilder.get(svcClient.errorCode)) .setAckFinalIndicator(propBuilder.get(svcClient.ackFinal)) .setResponseMessage(propBuilder.get(svcClient.errorMessage)) - .setServiceResponseInformation(build(serviceResponseInformation() + .setServiceResponseInformation(serviceResponseInformation() .setInstanceId(input.getServiceInformation().getServiceInstanceId()) - .setObjectPath(propBuilder.get(svcClient.serviceObjectPath)) - )) - ); + .setObjectPath(propBuilder.get(svcClient.serviceObjectPath)).build()) + .build(); } } |