Added unit tests for NextHopManager
[vpnservice.git] / nexthopmgr / nexthopmgr-impl / src / main / java / org / opendaylight / vpnservice / nexthopmgr / NexthopManager.java
index 5e565720f59df0f706c864c9546ee188d4d9edb5..8ea89397fcce4f331d70f43b8fd407fc95b638af 100644 (file)
@@ -117,7 +117,7 @@ public class NexthopManager implements L3nexthopService, AutoCloseable {
     }
 
 
-    private long getVpnId(String vpnName) {
+    protected long getVpnId(String vpnName) {
         InstanceIdentifierBuilder<VpnInstance> idBuilder = InstanceIdentifier.builder(VpnInstances.class)
                 .child(VpnInstance.class, new VpnInstanceKey(vpnName));
 
@@ -140,7 +140,7 @@ public class NexthopManager implements L3nexthopService, AutoCloseable {
         return dpn;
     }
 
-    private int createNextHopPointer(String nexthopKey) {
+    protected int createNextHopPointer(String nexthopKey) {
         GetUniqueIdInput getIdInput = new GetUniqueIdInputBuilder()
             .setPoolName("nextHopPointerPool").setIdKey(nexthopKey)
             .build();
@@ -170,7 +170,7 @@ public class NexthopManager implements L3nexthopService, AutoCloseable {
             // MAC re-write
             if (macAddress != null) {
                listActionInfo.add(0, new ActionInfo(ActionType.set_field_eth_dest, new String[]{macAddress}));
-               listActionInfo.add(new ActionInfo(ActionType.pop_mpls, new String[]{}));
+               listActionInfo.add(0, new ActionInfo(ActionType.pop_mpls, new String[]{}));
             } else {
                 //FIXME: Log message here.
                 LOG.debug("mac address for new local nexthop is null");
@@ -213,7 +213,7 @@ public class NexthopManager implements L3nexthopService, AutoCloseable {
         }
     }
 
-    private void addVpnNexthopToDS(long vpnId, String ipPrefix, long egressPointer) {
+    protected void addVpnNexthopToDS(long vpnId, String ipPrefix, long egressPointer) {
 
         InstanceIdentifierBuilder<VpnNexthops> idBuilder = InstanceIdentifier.builder(L3nexthop.class)
                 .child(VpnNexthops.class, new VpnNexthopsKey(vpnId));
@@ -270,7 +270,7 @@ public class NexthopManager implements L3nexthopService, AutoCloseable {
 
     }
 
-    private VpnNexthop getVpnNexthop(long vpnId, String ipAddress) {
+    protected VpnNexthop getVpnNexthop(long vpnId, String ipAddress) {
 
         // check if vpn node is there 
         InstanceIdentifierBuilder<VpnNexthops> idBuilder = InstanceIdentifier.builder(L3nexthop.class)