Bump upstream dependencies to latest Ca versions
[transportpce.git] / pce / src / test / java / org / opendaylight / transportpce / pce / impl / PceServiceRPCImplTest.java
index f727565746af27765200baa1f976f08ecb9b59c8..a90beececd7bbed77ca5b2dcb1d1e8fb1640bc6c 100644 (file)
@@ -14,6 +14,7 @@ import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 
+import com.google.common.collect.ClassToInstanceMap;
 import java.util.concurrent.ExecutionException;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -33,13 +34,13 @@ import org.opendaylight.transportpce.pce.utils.TransactionUtils;
 import org.opendaylight.transportpce.test.AbstractTest;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev240205.CancelResourceReserveInputBuilder;
 
+
 @ExtendWith(MockitoExtension.class)
 public class PceServiceRPCImplTest extends AbstractTest {
 
     private PathComputationService pathComputationService;
     private NotificationPublishService notificationPublishService;
     private NetworkTransactionImpl networkTransaction;
-    private PceServiceRPCImpl pceServiceRPC;
     @Mock
     private PortMapping portMapping;
     @Mock
@@ -54,33 +55,35 @@ public class PceServiceRPCImplTest extends AbstractTest {
         networkTransaction =  new NetworkTransactionImpl(getDataBroker());
         pathComputationService = new PathComputationServiceImpl(networkTransaction, notificationPublishService,
                 null, portMapping);
-        pceServiceRPC = new PceServiceRPCImpl(rpcProviderService, pathComputationService);
     }
 
     @Test
     void testRpcRegistration() {
-        verify(rpcProviderService, times(1)).registerRpcImplementations(any());
+        new PceServiceRPCImpl(rpcProviderService, pathComputationService);
+        verify(rpcProviderService, times(1)).registerRpcImplementations(any(ClassToInstanceMap.class));
     }
 
     @Test
     void testCancelResourceReserve() {
-        CancelResourceReserveInputBuilder cancelResourceReserveInput = new CancelResourceReserveInputBuilder();
-        assertNotNull(pceServiceRPC.cancelResourceReserve(cancelResourceReserveInput.build()));
+        assertNotNull(new CancelResourceReserveImpl(pathComputationService)
+                .invoke(new CancelResourceReserveInputBuilder().build()));
     }
 
     @Test
     void testPathComputationRequest() {
-        assertNotNull(pceServiceRPC.pathComputationRequest(PceTestData.getPCERequest()));
+        assertNotNull(new PathComputationRequestImpl(pathComputationService)
+                .invoke(PceTestData.getPCERequest()));
     }
 
     @Test
     void testPathComputationRerouteRequest() {
-        assertNotNull(pceServiceRPC.pathComputationRerouteRequest(PceTestData.getPCERerouteRequest()));
+        assertNotNull(new PathComputationRerouteRequestImpl(pathComputationService)
+                .invoke(PceTestData.getPCERerouteRequest()));
     }
 
     @Test
     void testPathComputationRequestCoRoutingOrGeneral2() {
-        assertNotNull(
-            pceServiceRPC.pathComputationRequest(PceTestData.getPathComputationRequestInputWithCoRoutingOrGeneral2()));
+        assertNotNull(new PathComputationRequestImpl(pathComputationService)
+                .invoke(PceTestData.getPathComputationRequestInputWithCoRoutingOrGeneral2()));
     }
 }