2 * Copyright © 2024 Smartoptics and others. 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.renderer.provisiondevice.transaction;
11 import org.junit.Assert;
12 import org.junit.jupiter.api.Test;
13 import org.mockito.Mockito;
14 import org.opendaylight.transportpce.renderer.provisiondevice.transaction.delete.Delete;
16 class DeviceInterfaceTest {
20 Delete delete = Mockito.mock(Delete.class);
21 Mockito.when(delete.deleteInterface("ROADM-A", "DEG1")).thenReturn(true);
23 DeviceInterface n1 = new DeviceInterface("ROADM-A", "DEG1");
24 Assert.assertTrue(n1.rollback(delete));
26 Mockito.verify(delete, Mockito.times(1)).deleteInterface("ROADM-A", "DEG1");
30 void testTwoInterfacesAreEqual() {
31 DeviceInterface n1 = new DeviceInterface("ROADM-A", "DEG1");
32 DeviceInterface n2 = new DeviceInterface("ROADM-A", "DEG1");
34 Assert.assertTrue(n1.equals(n2));
38 void testTwoInterfacesAreNotEqual() {
39 DeviceInterface n1 = new DeviceInterface("ROADM-A", "DEG1");
40 DeviceInterface n2 = new DeviceInterface("ROADM-B", "DEG1");
42 Assert.assertFalse(n1.equals(n2));