2 * Copyright © 2020 Orange. All rights reserved.
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
9 package org.opendaylight.transportpce.common.mapping;
11 import static org.junit.Assert.assertEquals;
12 import static org.mockito.Mockito.mock;
13 import static org.mockito.Mockito.when;
15 import org.junit.Before;
16 import org.junit.Test;
17 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.Port;
19 public class SortPort221ByNameTest {
22 public void setUp() throws Exception {
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 SortPort221ByName sortPort221ByName = new SortPort221ByName();
32 assertEquals(sortPort221ByName.compare(port2, port1), 1);