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.constraints;
11 import org.junit.Before;
12 import org.junit.Test;
13 import org.mockito.Mockito;
14 import org.opendaylight.transportpce.common.network.NetworkTransactionService;
15 import org.opendaylight.transportpce.pce.utils.PceTestData;
16 import org.opendaylight.transportpce.test.AbstractTest;
18 public class PceConstraintsCalcTest extends AbstractTest {
19 private static PceConstraintsCalc pceConstraintsCalc = null;
20 private static NetworkTransactionService networkTransactionService = null;
24 networkTransactionService = Mockito.mock(NetworkTransactionService.class);
29 public void testNoHardOrSoftConstrainsExists() {
30 pceConstraintsCalc = new PceConstraintsCalc(PceTestData
31 .getEmptyPCERequest(), networkTransactionService);
34 @Test(expected = NullPointerException.class)
35 public void testHardConstrainsExists() {
36 pceConstraintsCalc = new PceConstraintsCalc(PceTestData
37 .getPCE_test2_request_54(), networkTransactionService);
41 public void testSoftConstrainsExists() {
42 pceConstraintsCalc = new PceConstraintsCalc(PceTestData
43 .getPCERequest(), networkTransactionService);