Upgrade openroadm service models to 10.1
[transportpce.git] / servicehandler / src / test / java / org / opendaylight / transportpce / servicehandler / DowngradeConstraintsTest.java
1 /*
2  * Copyright © 2018 Orange, 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 package org.opendaylight.transportpce.servicehandler;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.opendaylight.transportpce.servicehandler.utils.ConstraintsUtils.buildHardConstraintWithCoRouting;
12 import static org.opendaylight.transportpce.servicehandler.utils.ConstraintsUtils.buildSoftConstraintWithCoRouting;
13
14 import org.junit.Test;
15 import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev211210.routing.constraints.HardConstraints;
16 import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev211210.routing.constraints.SoftConstraints;
17
18 /**
19  * Class to test downgrading and updating Constraints .
20  *
21  * @author Ahmed Helmy ( ahmad.helmy@orange.com )
22  *
23  */
24 public class DowngradeConstraintsTest {
25
26
27
28     @Test
29     public void testUpdateSoftConstraintsBothCoRouting() {
30         HardConstraints initialHardConstraints = buildHardConstraintWithCoRouting();
31         SoftConstraints initialSoftConstraints = buildSoftConstraintWithCoRouting();
32         SoftConstraints generatedSoftConstraints = DowngradeConstraints.updateSoftConstraints(
33                   initialHardConstraints, initialSoftConstraints);
34         assertEquals(
35                 generatedSoftConstraints.getCustomerCode().get(0),
36                 initialHardConstraints.getCustomerCode().get(0));
37     }
38 }