*/
package org.opendaylight.unimgr.mef.nrp.cisco.xr.l2vpn.helper;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
+import org.opendaylight.unimgr.mef.nrp.cisco.xr.common.ServicePort;
import org.opendaylight.unimgr.mef.nrp.cisco.xr.common.helper.InterfaceHelper;
-import org.opendaylight.yang.gen.v1.http.cisco.com.ns.yang.cisco.ios.xr.l2vpn.cfg.rev151109.l2vpn.database.xconnect.groups.xconnect.group.p2p.xconnects.p2p.xconnect.AttachmentCircuits;
-import org.opendaylight.yang.gen.v1.http.cisco.com.ns.yang.cisco.ios.xr.l2vpn.cfg.rev151109.l2vpn.database.xconnect.groups.xconnect.group.p2p.xconnects.p2p.xconnect.attachment.circuits.AttachmentCircuit;
-import org.opendaylight.yang.gen.v1.http.cisco.com.ns.yang.cisco.xr.types.rev150629.InterfaceName;
-import org.opendaylight.yang.gen.v1.urn.onf.core.network.module.rev160630.g_forwardingconstruct.FcPort;
+import org.opendaylight.yang.gen.v1.http.cisco.com.ns.yang.cisco.ios.xr.l2vpn.cfg.rev170626.l2vpn.database.xconnect.groups.xconnect.group.p2p.xconnects.p2p.xconnect.AttachmentCircuits;
+import org.opendaylight.yang.gen.v1.http.cisco.com.ns.yang.cisco.ios.xr.l2vpn.cfg.rev170626.l2vpn.database.xconnect.groups.xconnect.group.p2p.xconnects.p2p.xconnect.attachment.circuits.AttachmentCircuit;
+import org.opendaylight.yang.gen.v1.http.cisco.com.ns.yang.cisco.xr.types.rev171201.InterfaceName;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-/**
+/*
* @author krzysztof.bijakowski@amartus.com
*/
@RunWith(PowerMockRunner.class)
//given
InterfaceName interfaceName = new InterfaceName("GigabitEthernet0/0/1");
- FcPort port = Mockito.mock(FcPort.class);
+ ServicePort port = Mockito.mock(ServicePort.class);
PowerMockito.mockStatic(InterfaceHelper.class);
PowerMockito.when(InterfaceHelper.getInterfaceName(port)).thenReturn(interfaceName);
//when
- AttachmentCircuits actual = new AttachmentCircuitHelper().addPort(port).build();
+ AttachmentCircuits actual = new AttachmentCircuitHelper().addPort(port, true).build();
//then
List<AttachmentCircuit> actualAttachmentCircuitList = actual.getAttachmentCircuit();
AttachmentCircuit actualAttachmentCircuit = actualAttachmentCircuitList.get(0);
assertNotNull(actualAttachmentCircuit);
assertEquals(interfaceName, actualAttachmentCircuit.getName());
- assertTrue(actualAttachmentCircuit.isEnable());
+ assertNotNull(actualAttachmentCircuit.getEnable());
}
}