ceb55557ba72c9fb6d26197bda64e9b4b67f372b
[transportpce.git] / common / src / test / java / org / opendaylight / transportpce / common / mapping / SortPort221ByNameTest.java
1 /*
2  * Copyright © 2020 Orange.  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.common.mapping;
10
11 import static org.junit.Assert.assertEquals;
12 import static org.mockito.Mockito.mock;
13 import static org.mockito.Mockito.when;
14
15 import org.junit.Test;
16 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.Port;
17
18 public class SortPort221ByNameTest {
19
20     @Test
21     public void compareTest() {
22         Port port1 = mock(Port.class);
23         Port port2 = mock(Port.class);
24         when(port1.getPortName()).thenReturn("port1");
25         when(port2.getPortName()).thenReturn("port2");
26         SortPort221ByName sortPort221ByName = new SortPort221ByName();
27         assertEquals(sortPort221ByName.compare(port2, port1), 1);
28     }
29 }