Some tests for transportpce-common
[transportpce.git] / common / src / test / java / org / opendaylight / transportpce / common / mapping / SortPort121ByNameTest.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.Before;
16 import org.junit.Test;
17 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.Port;
18
19 public class SortPort121ByNameTest {
20
21     @Before
22     public void setUp() throws Exception {
23     }
24
25     @Test
26     public void compareTest() {
27         Port port1 = mock(Port.class);
28         Port port2 = mock(Port.class);
29         when(port1.getPortName()).thenReturn("port1");
30         when(port2.getPortName()).thenReturn("port2");
31         SortPort121ByName sortPort121ByName = new SortPort121ByName();
32         assertEquals(sortPort121ByName.compare(port2, port1), 1);
33
34     }
35 }