Refactor SH ServiceDataUtils tests
[transportpce.git] / servicehandler / src / test / java / org / opendaylight / transportpce / servicehandler / utils / ServiceDataUtils.java
index 88c426207c2421280a90b4d5a315a94bc159b3ec..b68207276511139b68ee95d15e5512864485073e 100644 (file)
@@ -61,13 +61,9 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.TempSer
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.TempServiceDeleteInputBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.delete.input.ServiceDeleteReqInfo;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.delete.input.ServiceDeleteReqInfoBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.feasibility.check.inputs.ServiceAEnd;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.feasibility.check.inputs.ServiceAEndBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.feasibility.check.inputs.ServiceZEnd;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.feasibility.check.inputs.ServiceZEndBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.AToZDirection;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.AToZDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.ZToADirection;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.ZToADirectionBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev220118.PceMetric;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev220118.RpcStatusEx;
@@ -80,97 +76,92 @@ import org.opendaylight.yangtools.yang.common.Uint8;
 public final class ServiceDataUtils {
 
     public static ServiceCreateInput buildServiceCreateInput() {
-
-        org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.create.input
-            .ServiceAEnd serviceAEnd = getServiceAEndBuild().build();
-        org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.create.input
-            .ServiceZEnd serviceZEnd = new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service
-            .create.input.ServiceZEndBuilder()
-            .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
-            .setNodeId(new NodeIdType("XPONDER-3-2"))
-            .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
-            .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
-            .build();
-
-        ServiceCreateInputBuilder builtInput = new ServiceCreateInputBuilder()
+        return new ServiceCreateInputBuilder()
             .setCommonId("commonId")
             .setConnectionType(ConnectionType.Service)
             .setCustomer("Customer")
             .setServiceName("service 1")
-            .setServiceAEnd(serviceAEnd)
-            .setServiceZEnd(serviceZEnd)
-            .setSdncRequestHeader(new SdncRequestHeaderBuilder().setRequestId("request 1")
-                .setRpcAction(RpcActions.ServiceCreate).setNotificationUrl("notification url").build());
-
-        return builtInput.build();
+            .setServiceAEnd(getServiceAEndBuild().build())
+            .setServiceZEnd(
+                new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+                        .service.create.input.ServiceZEndBuilder()
+                    .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
+                    .setNodeId(new NodeIdType("XPONDER-3-2"))
+                    .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
+                    .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
+                    .build())
+            .setSdncRequestHeader(
+                new SdncRequestHeaderBuilder()
+                    .setRequestId("request 1")
+                    .setRpcAction(RpcActions.ServiceCreate)
+                    .setNotificationUrl("notification url")
+                    .build())
+            .build();
     }
 
     public static ServiceCreateInput buildServiceCreateInputWithHardConstraints() {
-
-        org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.create.input
-                .ServiceAEnd serviceAEnd = getServiceAEndBuild()
-                .build();
-        org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.create.input
-                .ServiceZEnd serviceZEnd = new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service
-                .create.input.ServiceZEndBuilder()
-                .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
-                .setNodeId(new NodeIdType("XPONDER-3-2"))
-                .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
-                .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
-                .build();
-
-        ServiceCreateInputBuilder builtInput = new ServiceCreateInputBuilder()
+        return new ServiceCreateInputBuilder()
             .setCommonId("commonId")
             .setConnectionType(ConnectionType.Service)
             .setCustomer("Customer")
             .setServiceName("service 1")
-            .setServiceAEnd(serviceAEnd)
-            .setServiceZEnd(serviceZEnd)
-            .setSdncRequestHeader(new SdncRequestHeaderBuilder().setRequestId("request 1")
-                .setRpcAction(RpcActions.ServiceCreate).setNotificationUrl("notification url").build())
-            .setHardConstraints(new HardConstraintsBuilder().build());
-
-        return builtInput.build();
+            .setServiceAEnd(getServiceAEndBuild().build())
+            .setServiceZEnd(
+                new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+                        .service.create.input.ServiceZEndBuilder()
+                    .setClli("clli")
+                    .setServiceFormat(ServiceFormat.OC)
+                    .setServiceRate(Uint32.valueOf(1))
+                    .setNodeId(new NodeIdType("XPONDER-3-2"))
+                    .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
+                    .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
+                    .build())
+            .setSdncRequestHeader(
+                new SdncRequestHeaderBuilder()
+                    .setRequestId("request 1")
+                    .setRpcAction(RpcActions.ServiceCreate)
+                    .setNotificationUrl("notification url")
+                    .build())
+            .setHardConstraints(new HardConstraintsBuilder().build())
+            .build();
     }
 
     public static ServiceCreateInput buildServiceCreateInputWithSoftConstraints() {
-
-        org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.create.input
-                .ServiceAEnd serviceAEnd = getServiceAEndBuild()
-                .build();
-        org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.create.input
-                .ServiceZEnd serviceZEnd = new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service
-                .create.input.ServiceZEndBuilder()
-                .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
-                .setNodeId(new NodeIdType("XPONDER-3-2"))
-                .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
-                .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
-                .build();
-
-        ServiceCreateInputBuilder builtInput = new ServiceCreateInputBuilder()
+        return new ServiceCreateInputBuilder()
             .setCommonId("commonId")
             .setConnectionType(ConnectionType.Service)
             .setCustomer("Customer")
             .setServiceName("service 1")
-            .setServiceAEnd(serviceAEnd)
-            .setServiceZEnd(serviceZEnd)
-            .setSdncRequestHeader(new SdncRequestHeaderBuilder().setRequestId("request 1")
-                .setRpcAction(RpcActions.ServiceCreate).setNotificationUrl("notification url").build())
-            .setSoftConstraints(new SoftConstraintsBuilder().build());
-
-        return builtInput.build();
+            .setServiceAEnd(getServiceAEndBuild().build())
+            .setServiceZEnd(
+                new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+                        .service.create.input.ServiceZEndBuilder()
+                    .setClli("clli")
+                    .setServiceFormat(ServiceFormat.OC)
+                    .setServiceRate(Uint32.valueOf(1))
+                    .setNodeId(new NodeIdType("XPONDER-3-2"))
+                    .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
+                    .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
+                    .build())
+            .setSdncRequestHeader(
+                new SdncRequestHeaderBuilder()
+                    .setRequestId("request 1")
+                    .setRpcAction(RpcActions.ServiceCreate)
+                    .setNotificationUrl("notification url")
+                    .build())
+            .setSoftConstraints(new SoftConstraintsBuilder().build())
+            .build();
     }
 
     public static PathComputationRequestInput createPceRequestInput(ServiceCreateInput input) {
-        ServiceHandlerHeaderBuilder serviceHandlerHeader = new ServiceHandlerHeaderBuilder();
         SdncRequestHeader serviceHandler = input.getSdncRequestHeader();
-        if (serviceHandler != null) {
-            serviceHandlerHeader.setRequestId(serviceHandler.getRequestId());
-        }
         return new PathComputationRequestInputBuilder()
             .setServiceName(input.getServiceName())
             .setResourceReserve(true)
-            .setServiceHandlerHeader(serviceHandlerHeader.build())
+            .setServiceHandlerHeader(
+                serviceHandler == null
+                    ? new ServiceHandlerHeaderBuilder().build()
+                    : new ServiceHandlerHeaderBuilder().setRequestId(serviceHandler.getRequestId()).build())
             .setHardConstraints(input.getHardConstraints())
             .setSoftConstraints(input.getSoftConstraints())
             .setPceRoutingMetric(PceMetric.TEMetric)
@@ -180,194 +171,226 @@ public final class ServiceDataUtils {
     }
 
     public static TempServiceCreateInput buildTempServiceCreateInput() {
-
-        org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.temp.service.create.input
-            .ServiceAEnd serviceAEnd = new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.temp
-                .service.create.input.ServiceAEndBuilder()
-            .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
-            .setNodeId(new NodeIdType("XPONDER-1-2"))
-            .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
-            .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
-            .build();
-        org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.temp.service.create.input
-            .ServiceZEnd serviceZEnd = new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.temp
-            .service.create.input.ServiceZEndBuilder()
-            .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
-            .setNodeId(new NodeIdType("XPONDER-3-2"))
-            .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
-            .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
-            .build();
-
-        TempServiceCreateInputBuilder builtInput = new TempServiceCreateInputBuilder()
+        return new TempServiceCreateInputBuilder()
             .setCommonId("commonId")
             .setConnectionType(ConnectionType.Service)
             .setCustomer("Customer")
-            .setServiceAEnd(serviceAEnd)
-            .setServiceZEnd(serviceZEnd)
-            .setSdncRequestHeader(new SdncRequestHeaderBuilder().setRequestId("request 1")
-                .setRpcAction(RpcActions.TempServiceCreate).setNotificationUrl("notification url").build());
-
-        return builtInput.build();
-    }
-
-    public static ServiceFeasibilityCheckInput buildServiceFeasibilityCheckInput() {
-
-        ServiceAEnd serviceAEnd = new ServiceAEndBuilder()
+            .setServiceAEnd(
+                new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+                        .temp.service.create.input.ServiceAEndBuilder()
                     .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
                     .setNodeId(new NodeIdType("XPONDER-1-2"))
                     .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
-                    .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection())).build();
-        ServiceZEnd serviceZEnd = new ServiceZEndBuilder()
+                    .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
+                    .build())
+            .setServiceZEnd(
+                new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+                        .temp.service.create.input.ServiceZEndBuilder()
                     .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
                     .setNodeId(new NodeIdType("XPONDER-3-2"))
                     .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
-                    .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection())).build();
+                    .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
+                    .build())
+            .setSdncRequestHeader(
+                new SdncRequestHeaderBuilder()
+                    .setRequestId("request 1")
+                    .setRpcAction(RpcActions.TempServiceCreate)
+                    .setNotificationUrl("notification url")
+                    .build())
+            .build();
+    }
 
-        ServiceFeasibilityCheckInputBuilder builtInput = new ServiceFeasibilityCheckInputBuilder()
+    public static ServiceFeasibilityCheckInput buildServiceFeasibilityCheckInput() {
+        return new ServiceFeasibilityCheckInputBuilder()
             .setCommonId("commonId")
             .setConnectionType(ConnectionType.Service)
             .setCustomer("Customer")
-            .setServiceAEnd(serviceAEnd)
-            .setServiceZEnd(serviceZEnd)
-            .setSdncRequestHeader(new SdncRequestHeaderBuilder().setRequestId("request 1")
-                .setRpcAction(RpcActions.ServiceFeasibilityCheck).setNotificationUrl("notification url").build());
-        return builtInput.build();
+            .setServiceAEnd(
+                new ServiceAEndBuilder()
+                    .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
+                    .setNodeId(new NodeIdType("XPONDER-1-2"))
+                    .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
+                    .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
+                    .build())
+            .setServiceZEnd(
+                new ServiceZEndBuilder()
+                    .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
+                    .setNodeId(new NodeIdType("XPONDER-3-2"))
+                    .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
+                    .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
+                    .build())
+            .setSdncRequestHeader(
+                new SdncRequestHeaderBuilder()
+                    .setRequestId("request 1")
+                    .setRpcAction(RpcActions.ServiceFeasibilityCheck)
+                    .setNotificationUrl("notification url")
+                    .build())
+            .build();
     }
 
-    public static org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.create.input
-            .ServiceAEndBuilder getServiceAEndBuild() {
-        return new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.create.input
-                .ServiceAEndBuilder()
-            .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
+    public static org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+            .service.create.input.ServiceAEndBuilder getServiceAEndBuild() {
+        return new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+                .service.create.input.ServiceAEndBuilder()
+            .setClli("clli")
+            .setServiceFormat(ServiceFormat.OC)
+            .setServiceRate(Uint32.valueOf(1))
             .setNodeId(new NodeIdType("XPONDER-1-2"))
             .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
             .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()));
     }
 
-    public static org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.create.input
-        .ServiceZEndBuilder getServiceZEndBuild() {
-        return new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.create.input
-                .ServiceZEndBuilder()
-            .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
+    public static org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+            .service.create.input.ServiceZEndBuilder getServiceZEndBuild() {
+        return new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+                .service.create.input.ServiceZEndBuilder()
+            .setClli("clli")
+            .setServiceFormat(ServiceFormat.OC)
+            .setServiceRate(Uint32.valueOf(1))
             .setNodeId(new NodeIdType("XPONDER-1-2"))
             .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
             .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()));
     }
 
     private static TxDirection getTxDirection() {
-        return new org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.service
-                .endpoint.TxDirectionBuilder().setPort(new PortBuilder().setPortDeviceName("device name")
-                        .setPortName("port name").setPortRack("port rack").setPortShelf("port shelf")
-                        .setPortSlot("port slot").setPortSubSlot("port subslot").setPortType("port type").build())
-                        .setLgx(new LgxBuilder().setLgxDeviceName("lgx device name").setLgxPortName("lgx port name")
-                                .setLgxPortRack("lgx port rack").setLgxPortShelf("lgx port shelf").build())
-                        .setIndex(Uint8.ZERO)
-                        .build();
+        return new org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526
+                .service.endpoint.TxDirectionBuilder()
+            .setPort(
+                new PortBuilder()
+                    .setPortDeviceName("device name")
+                    .setPortName("port name")
+                    .setPortRack("port rack")
+                    .setPortShelf("port shelf")
+                    .setPortSlot("port slot")
+                    .setPortSubSlot("port subslot")
+                    .setPortType("port type")
+                    .build())
+            .setLgx(
+                new LgxBuilder()
+                    .setLgxDeviceName("lgx device name")
+                    .setLgxPortName("lgx port name")
+                    .setLgxPortRack("lgx port rack")
+                    .setLgxPortShelf("lgx port shelf")
+                    .build())
+            .setIndex(Uint8.ZERO)
+            .build();
     }
 
     private static RxDirection getRxDirection() {
-        return new org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526.service
-                .endpoint.RxDirectionBuilder()
-                    .setPort(new PortBuilder().setPortDeviceName("device name").setPortName("port name")
-                        .setPortRack("port rack").setPortShelf("port shelf").setPortSlot("port slot")
-                        .setPortSubSlot("port subslot").setPortType("port type").build())
-                    .setLgx(new LgxBuilder().setLgxDeviceName("lgx device name")
-                        .setLgxPortName("lgx port name").setLgxPortRack("lgx port rack")
-                        .setLgxPortShelf("lgx port shelf").build())
-                    .setIndex(Uint8.ZERO)
-                    .build();
+        return new org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev230526
+                .service.endpoint.RxDirectionBuilder()
+            .setPort(
+                new PortBuilder()
+                    .setPortDeviceName("device name")
+                    .setPortName("port name")
+                    .setPortRack("port rack")
+                    .setPortShelf("port shelf")
+                    .setPortSlot("port slot")
+                    .setPortSubSlot("port subslot")
+                    .setPortType("port type")
+                    .build())
+            .setLgx(
+                new LgxBuilder()
+                    .setLgxDeviceName("lgx device name")
+                    .setLgxPortName("lgx port name")
+                    .setLgxPortRack("lgx port rack")
+                    .setLgxPortShelf("lgx port shelf")
+                    .build())
+            .setIndex(Uint8.ZERO)
+            .build();
     }
 
     public static ServiceDeleteInput buildServiceDeleteInput() {
-
-        ServiceDeleteInputBuilder deleteInputBldr = new ServiceDeleteInputBuilder();
-        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx");
-        OffsetDateTime offsetDateTime = OffsetDateTime.now(ZoneOffset.UTC);
-        DateAndTime datetime = new DateAndTime(dtf.format(offsetDateTime));
-        deleteInputBldr.setServiceDeleteReqInfo(new ServiceDeleteReqInfoBuilder().setServiceName("service 1")
-            .setDueDate(datetime).setTailRetention(ServiceDeleteReqInfo.TailRetention.No).build());
-        SdncRequestHeaderBuilder sdncBuilder = new SdncRequestHeaderBuilder()
-            .setNotificationUrl("notification url")
-            .setRequestId("request 1")
-            .setRequestSystemId("request system 1")
-            .setRpcAction(RpcActions.ServiceDelete);
-        deleteInputBldr.setSdncRequestHeader(sdncBuilder.build());
-        return deleteInputBldr.build();
+        return new ServiceDeleteInputBuilder()
+            .setServiceDeleteReqInfo(
+                new ServiceDeleteReqInfoBuilder().setServiceName("service 1")
+                    .setDueDate(
+                        new DateAndTime(
+                            DateTimeFormatter
+                                .ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx")
+                                .format(OffsetDateTime.now(ZoneOffset.UTC))))
+                    .setTailRetention(ServiceDeleteReqInfo.TailRetention.No)
+                    .build())
+            .setSdncRequestHeader(
+                new SdncRequestHeaderBuilder()
+                    .setNotificationUrl("notification url")
+                    .setRequestId("request 1")
+                    .setRequestSystemId("request system 1")
+                    .setRpcAction(RpcActions.ServiceDelete)
+                    .build())
+            .build();
     }
 
     public static TempServiceDeleteInput buildTempServiceDeleteInput() {
-        TempServiceDeleteInputBuilder deleteInputBldr = new TempServiceDeleteInputBuilder()
-            .setCommonId("service 1");
-        return deleteInputBldr.build();
+        return new TempServiceDeleteInputBuilder().setCommonId("service 1").build();
     }
 
     public static TempServiceDeleteInput buildTempServiceDeleteInput(String commonId) {
-        TempServiceDeleteInputBuilder deleteInputBldr = new TempServiceDeleteInputBuilder()
-            .setCommonId(commonId);
-        return deleteInputBldr.build();
+        return new TempServiceDeleteInputBuilder().setCommonId(commonId).build();
     }
 
     public static ServiceRerouteInput buildServiceRerouteInput() {
-        ServiceRerouteInputBuilder builder = new ServiceRerouteInputBuilder()
-            .setServiceName("service 1");
-        return builder.build();
+        return new ServiceRerouteInputBuilder().setServiceName("service 1").build();
     }
 
     public static ServiceRestorationInput buildServiceRestorationInput() {
-        ServiceRestorationInputBuilder builder = new ServiceRestorationInputBuilder()
+        return new ServiceRestorationInputBuilder()
             .setServiceName("service 1")
-            .setOption(Option.Permanent);
-        return builder.build();
+            .setOption(Option.Permanent)
+            .build();
     }
 
     public static ServiceReconfigureInput buildServiceReconfigureInput() {
-
-        org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.reconfigure.input
-            .ServiceAEnd serviceAEnd = new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service
-                .reconfigure.input.ServiceAEndBuilder()
-                .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
-                .setNodeId(new NodeIdType("XPONDER-1-2"))
-                .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
-                .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
-                .build();
-        org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.reconfigure.input
-            .ServiceZEnd serviceZEnd = new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service
-                .reconfigure.input.ServiceZEndBuilder()
-                .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
-                .setNodeId(new NodeIdType("XPONDER-3-2"))
-                .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
-                .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
-                .build();
-
-        ServiceReconfigureInputBuilder builtInput = new ServiceReconfigureInputBuilder()
+        return new ServiceReconfigureInputBuilder()
             .setCommonId("commonId")
             .setConnectionType(ConnectionType.Service)
             .setCustomer("Customer")
             .setServiceName("service 1")
-            .setServiceAEnd(serviceAEnd)
-            .setServiceZEnd(serviceZEnd);
-        return builtInput.build();
+            .setServiceAEnd(
+                new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+                        .service.reconfigure.input.ServiceAEndBuilder()
+                    .setClli("clli")
+                    .setServiceFormat(ServiceFormat.OC)
+                    .setServiceRate(Uint32.valueOf(1))
+                    .setNodeId(new NodeIdType("XPONDER-1-2"))
+                    .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
+                    .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
+                    .build())
+            .setServiceZEnd(
+                new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+                        .service.reconfigure.input.ServiceZEndBuilder()
+                    .setClli("clli")
+                    .setServiceFormat(ServiceFormat.OC)
+                    .setServiceRate(Uint32.valueOf(1))
+                    .setNodeId(new NodeIdType("XPONDER-3-2"))
+                    .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
+                    .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()))
+                    .build())
+            .build();
     }
 
     public static ServicePathRpcResult buildServicePathRpcResult() {
-        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx");
-        OffsetDateTime offsetDateTime = OffsetDateTime.now(ZoneOffset.UTC);
-        DateAndTime datetime = new DateAndTime(dtf.format(offsetDateTime));
-        ServicePathRpcResultBuilder builder = new ServicePathRpcResultBuilder();
-        builder.setActualDate(datetime).setNotificationType(ServicePathNotificationTypes.PathComputationRequest)
+        return new ServicePathRpcResultBuilder()
+            .setActualDate(
+                new DateAndTime(
+                    DateTimeFormatter
+                        .ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx")
+                        .format(OffsetDateTime.now(ZoneOffset.UTC))))
+            .setNotificationType(ServicePathNotificationTypes.PathComputationRequest)
             .setPathDescription(createPathDescription(0,1, 0, 1))
             .setServiceName("service 1")
-            .setStatus(RpcStatusEx.Successful).setStatusMessage("success");
-        return builder.build();
+            .setStatus(RpcStatusEx.Successful).setStatusMessage("success")
+            .build();
     }
 
     public static ServicePathRpcResult buildServicePathRpcResult(
             ServicePathNotificationTypes servicePathNotificationTypes, String serviceName, RpcStatusEx rpcStatusEx,
             String message, Boolean pathDescription) {
-        ServicePathRpcResultBuilder builder = new ServicePathRpcResultBuilder();
-        builder.setNotificationType(servicePathNotificationTypes)
-                .setServiceName(serviceName)
-                .setStatus(rpcStatusEx).setStatusMessage(message);
+        ServicePathRpcResultBuilder builder = new ServicePathRpcResultBuilder()
+            .setNotificationType(servicePathNotificationTypes)
+            .setServiceName(serviceName)
+            .setStatus(rpcStatusEx)
+            .setStatusMessage(message);
         if (pathDescription) {
             builder.setPathDescription(createPathDescription(0L, 5L, 0L, 5L));
         }
@@ -375,101 +398,122 @@ public final class ServiceDataUtils {
     }
 
     public static ServicePathRpcResult buildFailedPceServicePathRpcResult() {
-        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx");
-        OffsetDateTime offsetDateTime = OffsetDateTime.now(ZoneOffset.UTC);
-        DateAndTime datetime = new DateAndTime(dtf.format(offsetDateTime));
-        ServicePathRpcResultBuilder builder = new ServicePathRpcResultBuilder();
-        builder.setActualDate(datetime).setNotificationType(ServicePathNotificationTypes.PathComputationRequest)
-                .setPathDescription(createPathDescription(0, 1, 0, 1)).setServiceName("service 1")
-                .setStatus(RpcStatusEx.Failed).setStatusMessage("failed");
-        return builder.build();
+        return new ServicePathRpcResultBuilder()
+            .setActualDate(
+                new DateAndTime(
+                    DateTimeFormatter
+                        .ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx")
+                        .format(OffsetDateTime.now(ZoneOffset.UTC))))
+            .setNotificationType(ServicePathNotificationTypes.PathComputationRequest)
+            .setPathDescription(createPathDescription(0, 1, 0, 1))
+            .setServiceName("service 1")
+            .setStatus(RpcStatusEx.Failed).setStatusMessage("failed")
+        .build();
     }
 
     public static ServicePathRpcResult buildFailedServicePathRpcResult() {
-        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx");
-        OffsetDateTime offsetDateTime = OffsetDateTime.now(ZoneOffset.UTC);
-        DateAndTime datetime = new DateAndTime(dtf.format(offsetDateTime));
-        ServicePathRpcResultBuilder builder = new ServicePathRpcResultBuilder();
-        builder.setActualDate(datetime).setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
+        return new ServicePathRpcResultBuilder()
+            .setActualDate(
+                new DateAndTime(
+                    DateTimeFormatter
+                        .ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx")
+                        .format(OffsetDateTime.now(ZoneOffset.UTC))))
+            .setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
             .setPathDescription(createPathDescription(0,1, 0, 1))
             .setServiceName("service 1")
-                .setStatus(RpcStatusEx.Failed).setStatusMessage("failed");
-        return builder.build();
+            .setStatus(RpcStatusEx.Failed)
+            .setStatusMessage("failed")
+            .build();
     }
 
     public static RendererRpcResultSp buildRendererRpcResultSp() {
-        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx");
-        OffsetDateTime offsetDateTime = OffsetDateTime.now(ZoneOffset.UTC);
-        DateAndTime datetime = new DateAndTime(dtf.format(offsetDateTime));
-        RendererRpcResultSpBuilder builder = new RendererRpcResultSpBuilder();
-        builder.setActualDate(datetime).setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
-                .setServiceName("service 1").setStatus(RpcStatusEx.Successful).setStatusMessage("success");
-        return builder.build();
+        return new RendererRpcResultSpBuilder()
+            .setActualDate(
+                new DateAndTime(
+                    DateTimeFormatter
+                        .ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx")
+                        .format(OffsetDateTime.now(ZoneOffset.UTC))))
+            .setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
+            .setServiceName("service 1")
+            .setStatus(RpcStatusEx.Successful)
+            .setStatusMessage("success")
+            .build();
     }
 
     public static RendererRpcResultSp buildRendererRpcResultSp(
             ServicePathNotificationTypes servicePathNotificationTypes,
             String serviceName, RpcStatusEx rpcStatusEx, String message) {
-        RendererRpcResultSpBuilder builder = new RendererRpcResultSpBuilder();
-        builder.setNotificationType(servicePathNotificationTypes).setServiceName(serviceName)
-                .setStatus(rpcStatusEx).setStatusMessage(message);
-        return builder.build();
+        return new RendererRpcResultSpBuilder()
+            .setNotificationType(servicePathNotificationTypes)
+            .setServiceName(serviceName)
+            .setStatus(rpcStatusEx)
+            .setStatusMessage(message)
+            .build();
     }
 
     public static ServiceRpcResultSh buildServiceRpcResultSh(
             ServiceNotificationTypes serviceNotificationTypes,
             String serviceName,
-            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev220118.RpcStatusEx
-                rpcStatusEx,
+            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev220118
+                .RpcStatusEx rpcStatusEx,
             String message) {
-        ServiceRpcResultShBuilder builder = new ServiceRpcResultShBuilder();
-        builder.setNotificationType(serviceNotificationTypes).setServiceName(serviceName)
-                .setStatus(rpcStatusEx).setStatusMessage(message);
-        return builder.build();
+        return new ServiceRpcResultShBuilder()
+            .setNotificationType(serviceNotificationTypes)
+            .setServiceName(serviceName)
+            .setStatus(rpcStatusEx)
+            .setStatusMessage(message)
+            .build();
     }
 
     public static RendererRpcResultSp buildFailedRendererRpcResultSp() {
-        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx");
-        OffsetDateTime offsetDateTime = OffsetDateTime.now(ZoneOffset.UTC);
-        DateAndTime datetime = new DateAndTime(dtf.format(offsetDateTime));
-        RendererRpcResultSpBuilder builder = new RendererRpcResultSpBuilder();
-        builder.setActualDate(datetime).setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
-                .setServiceName("service 1").setStatus(RpcStatusEx.Failed).setStatusMessage("failed");
-        return builder.build();
+        return new RendererRpcResultSpBuilder()
+            .setActualDate(
+                new DateAndTime(
+                    DateTimeFormatter
+                        .ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx")
+                        .format(OffsetDateTime.now(ZoneOffset.UTC))))
+            .setNotificationType(ServicePathNotificationTypes.ServiceImplementationRequest)
+            .setServiceName("service 1")
+            .setStatus(RpcStatusEx.Failed)
+            .setStatusMessage("failed")
+            .build();
     }
 
-    public static PathDescription createPathDescription(long azRate, long azWaveLength, long zaRate,
-        long zaWaveLength) {
-        AToZDirection atozDirection = new AToZDirectionBuilder()
-            .setRate(Uint32.valueOf(azRate))
-            .setAToZWavelengthNumber(Uint32.valueOf(azWaveLength))
-            .build();
-        ZToADirection ztoaDirection = new ZToADirectionBuilder()
-            .setRate(Uint32.valueOf(zaRate))
-            .setZToAWavelengthNumber(Uint32.valueOf(zaWaveLength))
-            .build();
-        PathDescription pathDescription = new PathDescriptionBuilder()
-            .setAToZDirection(atozDirection)
-            .setZToADirection(ztoaDirection)
+    public static PathDescription createPathDescription(
+            long azRate, long azWaveLength, long zaRate, long zaWaveLength) {
+        return new PathDescriptionBuilder()
+            .setAToZDirection(
+                new AToZDirectionBuilder()
+                    .setRate(Uint32.valueOf(azRate))
+                    .setAToZWavelengthNumber(Uint32.valueOf(azWaveLength))
+                    .build())
+            .setZToADirection(
+                new ZToADirectionBuilder()
+                    .setRate(Uint32.valueOf(zaRate))
+                    .setZToAWavelengthNumber(Uint32.valueOf(zaWaveLength))
+                    .build())
             .build();
-        return pathDescription;
     }
 
-    public static org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.reconfigure.input
-        .ServiceAEndBuilder getServiceAEndBuildReconfigure() {
-        return new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.reconfigure.input
-            .ServiceAEndBuilder()
-            .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
+    public static org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+            .service.reconfigure.input.ServiceAEndBuilder getServiceAEndBuildReconfigure() {
+        return new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+                .service.reconfigure.input.ServiceAEndBuilder()
+            .setClli("clli")
+            .setServiceFormat(ServiceFormat.OC)
+            .setServiceRate(Uint32.valueOf(1))
             .setNodeId(new NodeIdType("XPONDER-1-2"))
             .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
             .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()));
     }
 
-    public static org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.reconfigure.input
-        .ServiceZEndBuilder getServiceZEndBuildReconfigure() {
-        return new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.reconfigure.input
-            .ServiceZEndBuilder()
-            .setClli("clli").setServiceFormat(ServiceFormat.OC).setServiceRate(Uint32.valueOf(1))
+    public static org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+            .service.reconfigure.input.ServiceZEndBuilder getServiceZEndBuildReconfigure() {
+        return new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526
+                .service.reconfigure.input.ServiceZEndBuilder()
+            .setClli("clli")
+            .setServiceFormat(ServiceFormat.OC)
+            .setServiceRate(Uint32.valueOf(1))
             .setNodeId(new NodeIdType("XPONDER-1-2"))
             .setTxDirection(Map.of(new TxDirectionKey(getTxDirection().key()),getTxDirection()))
             .setRxDirection(Map.of(new RxDirectionKey(getRxDirection().key()), getRxDirection()));