Fix previous and add new PCE Junit test cases
[transportpce.git] / pce / src / test / java / org / opendaylight / transportpce / pce / constraints / PceConstraintsCalcTest.java
diff --git a/pce/src/test/java/org/opendaylight/transportpce/pce/constraints/PceConstraintsCalcTest.java b/pce/src/test/java/org/opendaylight/transportpce/pce/constraints/PceConstraintsCalcTest.java
new file mode 100644 (file)
index 0000000..f3d8152
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright © 2020 Orange Labs, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.transportpce.pce.constraints;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.opendaylight.transportpce.common.network.NetworkTransactionService;
+import org.opendaylight.transportpce.pce.utils.PceTestData;
+import org.opendaylight.transportpce.test.AbstractTest;
+
+public class PceConstraintsCalcTest extends AbstractTest {
+    private static PceConstraintsCalc pceConstraintsCalc = null;
+    private static NetworkTransactionService networkTransactionService = null;
+
+    @Before
+    public void setup() {
+        networkTransactionService = Mockito.mock(NetworkTransactionService.class);
+
+    }
+
+    @Test
+    public void testNoHardOrSoftConstrainsExists() {
+        pceConstraintsCalc = new PceConstraintsCalc(PceTestData
+                .getEmptyPCERequest(), networkTransactionService);
+    }
+
+    @Test(expected = NullPointerException.class)
+    public void testHardConstrainsExists() {
+        pceConstraintsCalc = new PceConstraintsCalc(PceTestData
+                .getPCE_test2_request_54(), networkTransactionService);
+    }
+
+    @Test
+    public void testSoftConstrainsExists() {
+        pceConstraintsCalc = new PceConstraintsCalc(PceTestData
+                .getPCERequest(), networkTransactionService);
+    }
+
+}