2 * Copyright © 2020 Orange Labs, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.transportpce.pce.impl;
11 import static org.junit.Assert.assertNotNull;
13 import org.junit.Before;
14 import org.junit.Test;
15 import org.mockito.Mockito;
16 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
17 import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
18 import org.opendaylight.transportpce.common.network.RequestProcessor;
19 import org.opendaylight.transportpce.pce.service.PathComputationService;
20 import org.opendaylight.transportpce.pce.service.PathComputationServiceImpl;
21 import org.opendaylight.transportpce.pce.utils.NotificationPublishServiceMock;
22 import org.opendaylight.transportpce.test.AbstractTest;
23 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.CancelResourceReserveInputBuilder;
24 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestInput;
25 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestInputBuilder;
30 public class PceServiceRPCImplTest extends AbstractTest {
32 private PathComputationService pathComputationService;
33 private NotificationPublishService notificationPublishService;
34 private NetworkTransactionImpl networkTransaction;
35 private RequestProcessor requestProcessor;
36 private PceServiceRPCImpl pceServiceRPC;
40 notificationPublishService = new NotificationPublishServiceMock();
41 requestProcessor = Mockito.mock(RequestProcessor.class);
42 networkTransaction = new NetworkTransactionImpl(requestProcessor);
43 pathComputationService = new PathComputationServiceImpl(networkTransaction, notificationPublishService);
44 pceServiceRPC = new PceServiceRPCImpl(pathComputationService);
48 public void testCancelResourceReserve() {
49 CancelResourceReserveInputBuilder cancelResourceReserveInput = new CancelResourceReserveInputBuilder();
50 assertNotNull(pceServiceRPC.cancelResourceReserve(cancelResourceReserveInput.build()));
54 public void testPathComputationRequest() {
55 PathComputationRequestInput pathComputationRequestInput =
56 new PathComputationRequestInputBuilder().build();
57 assertNotNull(pceServiceRPC.pathComputationRequest(pathComputationRequestInput));