Migrate common module to JUnit5
[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.jupiter.api.Assertions.assertEquals;
12 import static org.mockito.Mockito.mock;
13 import static org.mockito.Mockito.when;
14
15 import org.junit.jupiter.api.Test;
16 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.Port;
17
18 public class SortPort121ByNameTest {
19
20     @Test
21     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         SortPort121ByName sortPort121ByName = new SortPort121ByName();
27         assertEquals(sortPort121ByName.compare(port2, port1), 1);
28     }
29 }