Fix previous and add new PCE Junit test cases
[transportpce.git] / pce / src / test / java / org / opendaylight / transportpce / pce / constraints / PceConstraintsCalcTest.java
1 /*
2  * Copyright © 2020 Orange Labs, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.transportpce.pce.constraints;
10
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;
17
18 public class PceConstraintsCalcTest extends AbstractTest {
19     private static PceConstraintsCalc pceConstraintsCalc = null;
20     private static NetworkTransactionService networkTransactionService = null;
21
22     @Before
23     public void setup() {
24         networkTransactionService = Mockito.mock(NetworkTransactionService.class);
25
26     }
27
28     @Test
29     public void testNoHardOrSoftConstrainsExists() {
30         pceConstraintsCalc = new PceConstraintsCalc(PceTestData
31                 .getEmptyPCERequest(), networkTransactionService);
32     }
33
34     @Test(expected = NullPointerException.class)
35     public void testHardConstrainsExists() {
36         pceConstraintsCalc = new PceConstraintsCalc(PceTestData
37                 .getPCE_test2_request_54(), networkTransactionService);
38     }
39
40     @Test
41     public void testSoftConstrainsExists() {
42         pceConstraintsCalc = new PceConstraintsCalc(PceTestData
43                 .getPCERequest(), networkTransactionService);
44     }
45
46 }