code cleanup
[unimgr.git] / cisco-xr-driver / src / test / java / org / opendaylight / unimgr / mef / nrp / cisco / xr / l2vpn / helper / AttachmentCircuitHelperTest.java
index 006ac92964ce2dba470c2be2a3282293497b4bc8..21217d1934cc443f9442a1357525d28e6e9fa785 100644 (file)
@@ -7,26 +7,24 @@
  */
 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)
@@ -38,12 +36,12 @@ public class AttachmentCircuitHelperTest {
         //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();
@@ -53,6 +51,6 @@ public class AttachmentCircuitHelperTest {
         AttachmentCircuit actualAttachmentCircuit = actualAttachmentCircuitList.get(0);
         assertNotNull(actualAttachmentCircuit);
         assertEquals(interfaceName, actualAttachmentCircuit.getName());
-        assertTrue(actualAttachmentCircuit.isEnable());
+        assertNotNull(actualAttachmentCircuit.getEnable());
     }
 }