Remove pce-blueprint.xml file
[transportpce.git] / pce / src / test / java / org / opendaylight / transportpce / pce / impl / PceServiceRPCImplTest.java
index 609df3c96d0eaa271430a91e569b023b68762c99..6ebb56e10f5bcac1b0edb01daa70fbc328ecd8f3 100644 (file)
@@ -8,14 +8,16 @@
 
 package org.opendaylight.transportpce.pce.impl;
 
-import static org.junit.Assert.assertNotNull;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 import java.util.concurrent.ExecutionException;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mock;
 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
-import org.opendaylight.transportpce.common.network.RequestProcessor;
 import org.opendaylight.transportpce.pce.service.PathComputationService;
 import org.opendaylight.transportpce.pce.service.PathComputationServiceImpl;
 import org.opendaylight.transportpce.pce.utils.NotificationPublishServiceMock;
@@ -23,9 +25,7 @@ import org.opendaylight.transportpce.pce.utils.PceTestData;
 import org.opendaylight.transportpce.pce.utils.PceTestUtils;
 import org.opendaylight.transportpce.pce.utils.TransactionUtils;
 import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.CancelResourceReserveInputBuilder;
-
-
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.CancelResourceReserveInputBuilder;
 
 
 public class PceServiceRPCImplTest extends AbstractTest {
@@ -34,32 +34,39 @@ public class PceServiceRPCImplTest extends AbstractTest {
     private NotificationPublishService notificationPublishService;
     private NetworkTransactionImpl networkTransaction;
     private PceServiceRPCImpl pceServiceRPC;
+    @Mock
+    private PortMapping portMapping;
 
-    @Before
-    public void setUp() throws ExecutionException, InterruptedException {
-        PceTestUtils.writeNetworkIntoDataStore(this.getDataBroker(), this.getDataStoreContextUtil(),
+    @BeforeEach
+    void setUp() throws ExecutionException, InterruptedException {
+        PceTestUtils.writeNetworkIntoDataStore(getDataBroker(), getDataStoreContextUtil(),
                 TransactionUtils.getNetworkForSpanLoss());
         notificationPublishService = new NotificationPublishServiceMock();
-        networkTransaction =  new NetworkTransactionImpl(new RequestProcessor(this.getDataBroker()));
-        pathComputationService = new PathComputationServiceImpl(networkTransaction, notificationPublishService);
+        networkTransaction =  new NetworkTransactionImpl(getDataBroker());
+        pathComputationService = new PathComputationServiceImpl(networkTransaction, notificationPublishService,
+                null, portMapping);
         pceServiceRPC = new PceServiceRPCImpl(pathComputationService);
-
     }
 
     @Test
-    public void testCancelResourceReserve() {
+    void testCancelResourceReserve() {
         CancelResourceReserveInputBuilder cancelResourceReserveInput = new CancelResourceReserveInputBuilder();
         assertNotNull(pceServiceRPC.cancelResourceReserve(cancelResourceReserveInput.build()));
     }
 
     @Test
-    public void testPathComputationRequest() {
+    void testPathComputationRequest() {
         assertNotNull(pceServiceRPC.pathComputationRequest(PceTestData.getPCERequest()));
     }
 
     @Test
-    public void testPathComputationRequestCoRoutingOrGeneral2() {
-        assertNotNull(pceServiceRPC.pathComputationRequest(
-                PceTestData.getPathComputationRequestInputWithCoRoutingOrGeneral2()));
+    void testPathComputationRerouteRequest() {
+        assertNotNull(pceServiceRPC.pathComputationRerouteRequest(PceTestData.getPCERerouteRequest()));
+    }
+
+    @Test
+    void testPathComputationRequestCoRoutingOrGeneral2() {
+        assertNotNull(
+            pceServiceRPC.pathComputationRequest(PceTestData.getPathComputationRequestInputWithCoRoutingOrGeneral2()));
     }
 }