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;
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;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.CancelResourceReserveInputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestInputBuilder;
-
-
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.CancelResourceReserveInputBuilder;
private PathComputationService pathComputationService;
private NotificationPublishService notificationPublishService;
private NetworkTransactionImpl networkTransaction;
private PathComputationService pathComputationService;
private NotificationPublishService notificationPublishService;
private NetworkTransactionImpl networkTransaction;
+ public void setUp() throws ExecutionException, InterruptedException {
+ PceTestUtils.writeNetworkIntoDataStore(getDataBroker(), getDataStoreContextUtil(),
+ TransactionUtils.getNetworkForSpanLoss());
- requestProcessor = Mockito.mock(RequestProcessor.class);
- networkTransaction = new NetworkTransactionImpl(requestProcessor);
- pathComputationService = new PathComputationServiceImpl(networkTransaction, notificationPublishService);
+ networkTransaction = new NetworkTransactionImpl(new RequestProcessor(getDataBroker()));
+ pathComputationService = new PathComputationServiceImpl(networkTransaction, notificationPublishService,
+ null, portMapping);
- PathComputationRequestInput pathComputationRequestInput =
- new PathComputationRequestInputBuilder().build();
- assertNotNull(pceServiceRPC.pathComputationRequest(pathComputationRequestInput));
+ assertNotNull(pceServiceRPC.pathComputationRequest(PceTestData.getPCERequest()));
+ }
+
+ @Test
+ public void testPathComputationRerouteRequest() {
+ assertNotNull(pceServiceRPC.pathComputationRerouteRequest(PceTestData.getPCERerouteRequest()));