Boxing cleanup
[netvirt.git] / openstack / net-virt-providers / src / test / java / org / opendaylight / netvirt / openstack / netvirt / providers / openflow13 / services / IngressAclServiceTest.java
index 7f723569f68b47dbc6569bdb369a44b34e3ce51a..a4a3d388d5886859805a84d0323eb956a4eae37b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 - 2016 Inocybe and others.  All rights reserved.
+ * Copyright © 2015, 2017 Inocybe and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -49,6 +49,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.Icmpv6Match;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatch;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.UdpMatch;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.powermock.api.mockito.PowerMockito;
 import org.powermock.api.support.membermodification.MemberModifier;
@@ -79,6 +80,7 @@ public class IngressAclServiceTest {
     @Mock private SecurityServicesManager securityServices;
     @Mock private SecurityGroupCacheManger securityGroupCacheManger;
     @Mock private INeutronSecurityRuleCRUD neutronSecurityRuleCache;
+    @Mock private NodeId nodeId;
 
     private List<Neutron_IPs> neutronSrcIpList = new ArrayList<>();
     private List<Neutron_IPs> neutronDestIpList = new ArrayList<>();
@@ -108,14 +110,10 @@ public class IngressAclServiceTest {
     private static NodeBuilder nodeBuilder;
 
     private static Answer<Object> answer() {
-        return new Answer<Object>() {
-            @Override
-            public CheckedFuture<Void, TransactionCommitFailedException> answer(InvocationOnMock invocation)
-                    throws Throwable {
-                flowBuilder = (FlowBuilder) invocation.getArguments()[0];
-                nodeBuilder = (NodeBuilder) invocation.getArguments()[1];
-                return null;
-            }
+        return invocation -> {
+            flowBuilder = (FlowBuilder) invocation.getArguments()[0];
+            nodeBuilder = (NodeBuilder) invocation.getArguments()[1];
+            return null;
         };
     }
 
@@ -174,7 +172,7 @@ public class IngressAclServiceTest {
     /**
      * Test method {@link EgressAclService#programPortSecurityGroup(java.lang.Long, java.lang.String,
      * java.lang.String, long, NeutronSecurityGroup,
-     * java.lang.String, boolean)} when portSecurityRule is incomplete
+     * java.lang.String, NodeId, boolean)} when portSecurityRule is incomplete
      */
     @Test
     public void testProgramPortSecurityGroupWithIncompleteRule() throws Exception {
@@ -205,7 +203,7 @@ public class IngressAclServiceTest {
         when(neutronSecurityRuleCache.getAllNeutronSecurityRules()).thenReturn(portSecurityList);
 
         ingressAclServiceSpy.programPortSecurityGroup(
-                Long.valueOf(1554), "2", MAC_ADDRESS, 124, localSecurityGroup, PORT_UUID, false);
+                1554L, "2", MAC_ADDRESS, 124, localSecurityGroup, PORT_UUID, nodeId, false);
     }
 
     /**
@@ -218,7 +216,7 @@ public class IngressAclServiceTest {
         when(portSecurityRule.getSecurityRulePortMin()).thenReturn(null);
         when(portSecurityRule.getSecurityRuleRemoteIpPrefix()).thenReturn(null);
 
-        ingressAclServiceSpy.programPortSecurityGroup(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID,true);
+        ingressAclServiceSpy.programPortSecurityGroup(1554L, "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID, nodeId, true);
 
         verify(writeTransaction, times(1)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), eq(true));
         verify(writeTransaction, times(1)).submit();
@@ -235,7 +233,7 @@ public class IngressAclServiceTest {
         when(portSecurityIpv6Rule.getSecurityRulePortMin()).thenReturn(null);
         when(portSecurityIpv6Rule.getSecurityRuleRemoteIpPrefix()).thenReturn(null);
 
-        ingressAclServiceSpy.programPortSecurityGroup(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroupIpv6, PORT_UUID, true);
+        ingressAclServiceSpy.programPortSecurityGroup(1554L, "2", MAC_ADDRESS, 124, securityGroupIpv6, PORT_UUID, nodeId, true);
 
         verify(writeTransaction, times(1)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), eq(true));
         verify(writeTransaction, times(1)).submit();
@@ -252,7 +250,7 @@ public class IngressAclServiceTest {
         when(portSecurityRule.getSecurityRulePortMin()).thenReturn(null);
         when(portSecurityRule.getSecurityRuleRemoteIpPrefix()).thenReturn(null);
 
-        ingressAclServiceSpy.programPortSecurityGroup(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID,false);
+        ingressAclServiceSpy.programPortSecurityGroup(1554L, "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID, nodeId, false);
 
         verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
         verify(writeTransaction, times(1)).submit();
@@ -269,7 +267,7 @@ public class IngressAclServiceTest {
         when(portSecurityIpv6Rule.getSecurityRulePortMin()).thenReturn(null);
         when(portSecurityIpv6Rule.getSecurityRuleRemoteIpPrefix()).thenReturn(null);
 
-        ingressAclServiceSpy.programPortSecurityGroup(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroupIpv6, PORT_UUID, false);
+        ingressAclServiceSpy.programPortSecurityGroup(1554L, "2", MAC_ADDRESS, 124, securityGroupIpv6, PORT_UUID, nodeId, false);
 
         verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
         verify(writeTransaction, times(1)).submit();
@@ -289,7 +287,7 @@ public class IngressAclServiceTest {
                                              any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, true);
+                                                      PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -317,7 +315,7 @@ public class IngressAclServiceTest {
                 any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, true);
+                PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -345,7 +343,7 @@ public class IngressAclServiceTest {
                                              any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, false);
+                                                      PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -373,7 +371,7 @@ public class IngressAclServiceTest {
                 any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, false);
+                PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -401,7 +399,7 @@ public class IngressAclServiceTest {
         PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
                                              any(NodeBuilder.class));
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, true);
+                                                      PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -437,7 +435,7 @@ public class IngressAclServiceTest {
         PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
                 any(NodeBuilder.class));
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, true);
+                PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -474,7 +472,7 @@ public class IngressAclServiceTest {
                                              any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, false);
+                                                      PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -512,7 +510,7 @@ public class IngressAclServiceTest {
                 any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, false);
+                PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -548,7 +546,7 @@ public class IngressAclServiceTest {
                                              any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, true);
+                                                      PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -573,7 +571,7 @@ public class IngressAclServiceTest {
                 any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, true);
+                PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -598,7 +596,7 @@ public class IngressAclServiceTest {
                                              any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, false);
+                                                      PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -623,7 +621,7 @@ public class IngressAclServiceTest {
                 any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, false);
+                PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -647,7 +645,7 @@ public class IngressAclServiceTest {
         PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
                                              any(NodeBuilder.class));
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, true);
+                                                      PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -679,7 +677,7 @@ public class IngressAclServiceTest {
         PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
                 any(NodeBuilder.class));
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, true);
+                PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -712,7 +710,7 @@ public class IngressAclServiceTest {
                                              any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, false);
+                                                      PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -746,7 +744,7 @@ public class IngressAclServiceTest {
                 any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, false);
+                PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -780,7 +778,7 @@ public class IngressAclServiceTest {
                                              any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, true);
+                                                      PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -808,7 +806,7 @@ public class IngressAclServiceTest {
                 any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, true);
+                PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -836,7 +834,7 @@ public class IngressAclServiceTest {
                                              any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, false);
+                                                      PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -864,7 +862,7 @@ public class IngressAclServiceTest {
                 any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, false);
+                PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -892,7 +890,7 @@ public class IngressAclServiceTest {
         PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
                                              any(NodeBuilder.class));
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, true);
+                                                      PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -928,7 +926,7 @@ public class IngressAclServiceTest {
         PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
                 any(NodeBuilder.class));
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, true);
+                PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -964,7 +962,7 @@ public class IngressAclServiceTest {
         PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "removeFlow", any(FlowBuilder.class),
                                              any(NodeBuilder.class));
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, false);
+                                                      PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -1000,7 +998,7 @@ public class IngressAclServiceTest {
         PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "removeFlow", any(FlowBuilder.class),
                 any(NodeBuilder.class));
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, false);
+                PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -1036,7 +1034,7 @@ public class IngressAclServiceTest {
                                              any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, true);
+                                                      PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -1061,7 +1059,7 @@ public class IngressAclServiceTest {
                 any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, true);
+                PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -1086,7 +1084,7 @@ public class IngressAclServiceTest {
                                              any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, false);
+                                                      PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -1111,7 +1109,7 @@ public class IngressAclServiceTest {
                 any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, false);
+                PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -1136,7 +1134,7 @@ public class IngressAclServiceTest {
         PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
                                              any(NodeBuilder.class));
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, true);
+                                                      PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -1169,7 +1167,7 @@ public class IngressAclServiceTest {
         PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
                 any(NodeBuilder.class));
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, true);
+                PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -1202,7 +1200,7 @@ public class IngressAclServiceTest {
         PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "removeFlow", any(FlowBuilder.class),
                                              any(NodeBuilder.class));
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroup,
-                                                      PORT_UUID, false);
+                                                      PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -1235,7 +1233,7 @@ public class IngressAclServiceTest {
         PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "removeFlow", any(FlowBuilder.class),
                 any(NodeBuilder.class));
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID, MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6,
-                PORT_UUID, false);
+                PORT_UUID, nodeId, false);
 
         Match match = flowBuilder.getMatch();
         EthernetMatch ethMatch = match.getEthernetMatch();
@@ -1268,7 +1266,7 @@ public class IngressAclServiceTest {
         PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
                                              any(NodeBuilder.class));
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
-                                                    MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, true);
+                                                    MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, nodeId, true);
         Match match = flowBuilder.getMatch();
         Icmpv4Match icmpv4Match = match.getIcmpv4Match();
         Assert.assertEquals(10, icmpv4Match.getIcmpv4Type().shortValue());
@@ -1296,7 +1294,7 @@ public class IngressAclServiceTest {
         PowerMockito.doAnswer(answer()).when(ingressAclServiceSpy, "writeFlow", any(FlowBuilder.class),
                 any(NodeBuilder.class));
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
-                MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, true);
+                MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, nodeId, true);
 
         Match match = flowBuilder.getMatch();
         Icmpv6Match icmpv6Match = match.getIcmpv6Match();
@@ -1325,7 +1323,7 @@ public class IngressAclServiceTest {
                                              any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
-                                                    MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, false);
+                                                    MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, nodeId, false);
         Match match = flowBuilder.getMatch();
         Icmpv4Match icmpv4Match = match.getIcmpv4Match();
         Assert.assertEquals(20, icmpv4Match.getIcmpv4Type().shortValue());
@@ -1353,7 +1351,7 @@ public class IngressAclServiceTest {
                 any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
-                MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, false);
+                MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, nodeId, false);
         Match match = flowBuilder.getMatch();
         Icmpv6Match icmpv6Match = match.getIcmpv6Match();
         Assert.assertEquals(20, icmpv6Match.getIcmpv6Type().shortValue());
@@ -1381,7 +1379,7 @@ public class IngressAclServiceTest {
                                              any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
-                                                    MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, true);
+                                                    MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, nodeId, true);
         Match match = flowBuilder.getMatch();
         Icmpv4Match icmpv4Match =match.getIcmpv4Match();
         Assert.assertEquals(30, icmpv4Match.getIcmpv4Type().shortValue());
@@ -1416,7 +1414,7 @@ public class IngressAclServiceTest {
                 any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
-                MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, true);
+                MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, nodeId, true);
         Match match = flowBuilder.getMatch();
         Icmpv6Match icmpv6Match =match.getIcmpv6Match();
         Assert.assertEquals(30, icmpv6Match.getIcmpv6Type().shortValue());
@@ -1452,7 +1450,7 @@ public class IngressAclServiceTest {
         .when(ingressAclServiceSpy, "removeFlow", any(FlowBuilder.class), any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
-                                                    MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, false);
+                                                    MAC_ADDRESS, LOCAL_PORT, securityGroup, PORT_UUID, nodeId, false);
         Match match = flowBuilder.getMatch();
         Icmpv4Match icmpv4Match = match.getIcmpv4Match();
         Assert.assertEquals(40, icmpv4Match.getIcmpv4Type().shortValue());
@@ -1487,7 +1485,7 @@ public class IngressAclServiceTest {
                 .when(ingressAclServiceSpy, "removeFlow", any(FlowBuilder.class), any(NodeBuilder.class));
 
         ingressAclServiceSpy.programPortSecurityGroup(DP_ID_LONG, SEGMENT_ID,
-                MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, false);
+                MAC_ADDRESS, LOCAL_PORT, securityGroupIpv6, PORT_UUID, nodeId, false);
         Match match = flowBuilder.getMatch();
         Icmpv6Match icmpv6Match = match.getIcmpv6Match();
         Assert.assertEquals(40, icmpv6Match.getIcmpv6Type().shortValue());
@@ -1516,7 +1514,7 @@ public class IngressAclServiceTest {
     public void testProgramPortSecurityACLRuleInvalidEther() throws Exception {
         when(portSecurityRule.getSecurityRuleEthertype()).thenReturn("IP");
 
-        ingressAclServiceSpy.programPortSecurityGroup(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID,false);
+        ingressAclServiceSpy.programPortSecurityGroup(1554L, "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID, nodeId, false);
 
         verify(writeTransaction, times(0)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
         verify(writeTransaction, times(0)).submit();
@@ -1530,7 +1528,7 @@ public class IngressAclServiceTest {
     public void testProgramPortSecurityACLRuleInvalidDirection() throws Exception {
         when(portSecurityRule.getSecurityRuleDirection()).thenReturn("edgress");
 
-        ingressAclServiceSpy.programPortSecurityGroup(Long.valueOf(1554), "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID,false);
+        ingressAclServiceSpy.programPortSecurityGroup(1554L, "2", MAC_ADDRESS, 124, securityGroup,PORT_UUID, nodeId, false);
 
         verify(writeTransaction, times(0)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
         verify(writeTransaction, times(0)).submit();
@@ -1544,7 +1542,7 @@ public class IngressAclServiceTest {
     public void testProgramFixedSecurityACLAdd2() throws Exception {
         when(securityServices.isConntrackEnabled()).thenReturn(false);
 
-        ingressAclServiceSpy.programFixedSecurityGroup(Long.valueOf(1554), "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, true);
+        ingressAclServiceSpy.programFixedSecurityGroup(1554L, "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, true);
 
         verify(writeTransaction, times(3)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), eq(true));
         verify(writeTransaction, times(3)).submit();
@@ -1557,7 +1555,7 @@ public class IngressAclServiceTest {
     public void testProgramFixedSecurityACLRemove2() throws Exception {
         when(securityServices.isConntrackEnabled()).thenReturn(false);
 
-        ingressAclServiceSpy.programFixedSecurityGroup(Long.valueOf(1554), "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, false);
+        ingressAclServiceSpy.programFixedSecurityGroup(1554L, "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, false);
 
         verify(writeTransaction, times(3)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
         verify(writeTransaction, times(3)).submit();
@@ -1570,7 +1568,7 @@ public class IngressAclServiceTest {
     public void testProgramFixedSecurityACLAdd4() throws Exception {
         when(securityServices.isConntrackEnabled()).thenReturn(true);
 
-        ingressAclServiceSpy.programFixedSecurityGroup(Long.valueOf(1554), "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, true);
+        ingressAclServiceSpy.programFixedSecurityGroup(1554L, "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, true);
 
         verify(writeTransaction, times(8)).put(any(LogicalDatastoreType.class), any(InstanceIdentifier.class), any(Node.class), eq(true));
         verify(writeTransaction, times(8)).submit();
@@ -1583,7 +1581,7 @@ public class IngressAclServiceTest {
     public void testProgramFixedSecurityACLRemove4() throws Exception {
         when(securityServices.isConntrackEnabled()).thenReturn(true);
 
-        ingressAclServiceSpy.programFixedSecurityGroup(Long.valueOf(1554), "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, false);
+        ingressAclServiceSpy.programFixedSecurityGroup(1554L, "2", DHCP_MAC_ADDRESS, 1, MAC_ADDRESS, false);
 
         verify(writeTransaction, times(8)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class));
         verify(writeTransaction, times(8)).submit();