Basically I added tests, mainly Mockito.verify(). And I refactored, updated and cleaned up the classes.
Change-Id: I1d3f2c7966a7edb1ad7d41d53cdba1e37cb1082c
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
import org.osgi.framework.ServiceReference;
/**
- * Unit test for class EventDispatcherImpl
+ * Unit test for {@link EventDispatcherImpl}
*/
@RunWith(MockitoJUnitRunner.class)
public class EventDispatcherImplTest {
@InjectMocks EventDispatcherImpl eventDispatcherImpl;
private AbstractEvent.HandlerType handlerTypeObject = AbstractEvent.HandlerType.NEUTRON_FLOATING_IP;
- public ServiceReference ref = mock(ServiceReference.class);
+ private ServiceReference ref = mock(ServiceReference.class);
@Before
public void setUp() {
}
/**
- * Test method {@link EventDispatcherImpl#eventHandlerAdded(ServiceReference, AbstractHandler)}
+ * Test methods {@link EventDispatcherImpl#eventHandlerRemoved(ServiceReference)}
+ * and {@link EventDispatcherImpl#eventHandlerAdded(ServiceReference, AbstractHandler)}
*/
@Test
- public void testeventHandlerAdded() throws Exception{
+ public void testHandlerAddedAndRemoved() throws Exception{
AbstractHandler[] handlers = ( AbstractHandler[]) getClassField("handlers");
assertNotEquals("Error, handler should be null", handlers[handlerTypeObject.ordinal()], handler);
eventDispatcherImpl.eventHandlerAdded(ref, handler);
assertEquals("Error, did not return the added handler", handlers[handlerTypeObject.ordinal()], handler);
- }
-
- /**
- * Test method {@link EventDispatcherImpl#eventHandlerRemoved(ServiceReference)}
- */
- @Test
- public void testHandlerRemoved() throws Exception{
- AbstractHandler[] handlers = ( AbstractHandler[]) getClassField("handlers");
-
- eventDispatcherImpl.eventHandlerAdded(ref, handler);
-
- assertEquals("Error, did not return the added handler", handlers[handlerTypeObject.ordinal()], handler);
eventDispatcherImpl.eventHandlerRemoved(ref);
import org.opendaylight.ovsdb.lib.notation.Row;
import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
import org.opendaylight.ovsdb.openstack.netvirt.api.Action;
-import org.opendaylight.ovsdb.openstack.netvirt.api.ArpProvider;
import org.opendaylight.ovsdb.openstack.netvirt.api.ConfigurationService;
-import org.opendaylight.ovsdb.openstack.netvirt.api.InboundNatProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.L3ForwardingProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.MultiTenantAwareRouter;
-import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
-import org.opendaylight.ovsdb.openstack.netvirt.api.OutboundNatProvider;
-import org.opendaylight.ovsdb.openstack.netvirt.api.RoutingProvider;
import org.opendaylight.ovsdb.openstack.netvirt.api.TenantNetworkManager;
import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
@RunWith(PowerMockRunner.class)
public class NeutronL3AdapterTest {
+ @InjectMocks NeutronL3Adapter neutronL3Adapter;
+
@Mock private ConfigurationService configurationService;
@Mock private TenantNetworkManager tenantNetworkManager;
@Mock private OvsdbConfigurationService ovsdbConfigurationService;
@Mock private INeutronNetworkCRUD neutronNetworkCache;
@Mock private INeutronSubnetCRUD neutronSubnetCache;
@Mock private INeutronPortCRUD neutronPortCache;
-
- @Mock private NeutronPort neutronPort;
- @Mock private Neutron_IPs neutronIP;
- @Mock private NeutronRouter neutronRouter;
- @Mock private NeutronRouter_Interface neutronRouterInterface;
- @Mock private NeutronSubnet neutronSubnet;
- @Mock private NeutronNetwork neutronNetwork;
- @Mock private Node node;
- @Mock private NodeId nodeID;
- @Mock private Row row;
- @Mock private Bridge bridge;
- @Mock private Status status;
- @InjectMocks NeutronL3Adapter neutronL3Adapter;
+ @Mock NeutronPort neutronPort;
private Set<String> inboundIpRewriteCache;
private Set<String> outboundIpRewriteCache;
}
private void setUpVar(){
+ Neutron_IPs neutronIP = mock(Neutron_IPs.class);
+ NeutronRouter neutronRouter = mock(NeutronRouter.class);
+
+ NeutronSubnet neutronSubnet = mock(NeutronSubnet.class);
+ NeutronNetwork neutronNetwork = mock(NeutronNetwork.class);
+ Node node = mock(Node.class);
+ NodeId nodeID = mock(NodeId.class);
+ Row row = mock(Row.class);
+ Bridge bridge = mock(Bridge.class);
+ Status status = mock(Status.class);
+
List<Neutron_IPs> list_neutronIP = new ArrayList<Neutron_IPs>();
list_neutronIP.add(neutronIP);
when(neutronIP.getSubnetUUID()).thenReturn("subnetUUID");
when(neutronIP.getIpAddress()).thenReturn(HOST_ADDRESS);
- when(neutronRouterInterface.getPortUUID()).thenReturn("portUUID");
- when(neutronRouterInterface.getSubnetUUID()).thenReturn("subnetUUID");
-
when(neutronPortCache.getAllPorts()).thenReturn(list_neutronPort);
when(neutronPortCache.getPort(anyString())).thenReturn(neutronPort);
// populate subnetIdToRouterInterfaceCache to pass the
// if (neutronRouterInterface != null)
+ NeutronRouter_Interface neutronRouterInterface = mock(NeutronRouter_Interface.class);
+ when(neutronRouterInterface.getPortUUID()).thenReturn("portUUID");
+ when(neutronRouterInterface.getSubnetUUID()).thenReturn("subnetUUID");
subnetIdToRouterInterfaceCache.put("subnetUUID", neutronRouterInterface);
/* device owner = "" */
assertEquals("Error, did not return the correct subnetIdToRouterInterfaceCache size", 0, subnetIdToRouterInterfaceCache.size());
assertEquals("Error, did not return the correct l3ForwardingCache size", 0, l3ForwardingCache.size());
assertEquals("Error, did not return the correct defaultRouteCache size", 0, defaultRouteCache.size());
-
}
}
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import java.lang.reflect.Field;
import java.util.HashMap;
-import java.util.Random;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Spy;
import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProvider;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.osgi.framework.ServiceReference;
/**
- * Unit test for class ProviderNetworkManagerImpl
- *
- * TODO In order to have deeper tests, private inner class
- * ProviderEntry of ProviderNetworkManager should be public.
+ * Unit test for {@link ProviderNetworkManagerImpl}
*/
@RunWith(MockitoJUnitRunner.class)
public class ProviderNetworkManagerImplTest {
@InjectMocks private ProviderNetworkManagerImpl providerNetworkManagerImpl;
@Spy private HashMap<Node, NetworkingProvider> nodeToProviderMapping;
- private Random r = new Random();
-
/**
* Test method {@link ProviderNetworkManagerImpl#getProvider(Node)}
*/
@Test
public void testGetProvider(){
+ // TODO test the method with no networkingProvider in the map
+ // Could not be done as ProviderEntry is a private inner class of ProviderNetworkManagerImpl
+// assertNotNull("Error, did not return the networkingProvider of the specified node", providerNetworkManagerImpl.getProvider(any(Node.class));
+
Node node = mock(Node.class);
NetworkingProvider networkingProvider = mock(NetworkingProvider.class);
-
- // populate nodeToProviderMapping
nodeToProviderMapping.put(node, networkingProvider);
-
- // test when nodeToProviderMapping is populate
assertEquals("Error, did not return the networkingProvider of the specified node", networkingProvider, providerNetworkManagerImpl.getProvider(node));
}
/**
- * Test method {@link ProviderNetworkManagerImpl#providerAdded(ServiceReference, NetworkingProvider)}
+ * Test methods {@link ProviderNetworkManagerImpl#providerRemoved(ServiceReference)}
+ * and {@link ProviderNetworkManagerImpl#providerAdded(ServiceReference, NetworkingProvider)}
*/
@Test
- public void testProviderAdded(){
- ServiceReference ref = mock(ServiceReference.class);
+ public void testProviderAddedAndRemoved() throws Exception {
+ Field field = ProviderNetworkManagerImpl.class.getDeclaredField("providers");
+ field.setAccessible(true);
+ HashMap map = (HashMap) field.get(providerNetworkManagerImpl);
- // configure ref
- when(ref.getProperty(org.osgi.framework.Constants.SERVICE_ID)).thenReturn(r.nextLong());
- when(ref.getProperty(Constants.SOUTHBOUND_PROTOCOL_PROPERTY)).thenReturn("proto");
- when(ref.getProperty(Constants.OPENFLOW_VERSION_PROPERTY)).thenReturn("of");
- when(ref.getProperty(Constants.PROVIDER_TYPE_PROPERTY)).thenReturn("provider");
+ ServiceReference ref = mock(ServiceReference.class);
+ when(ref.getProperty(org.osgi.framework.Constants.SERVICE_ID)).thenReturn(Long.valueOf(1));
- // nothing much to test
providerNetworkManagerImpl.providerAdded(ref, mock(NetworkingProvider.class));
- }
- /**
- * Test method {@link ProviderNetworkManagerImpl#providerRemoved(ServiceReference)}
- */
- @Test
- public void testProviderRemoved(){
- ServiceReference ref = mock(ServiceReference.class);
-
- // configure ref
- when(ref.getProperty(org.osgi.framework.Constants.SERVICE_ID)).thenReturn(r.nextLong());
+ assertEquals("Error, providerAdded() did not add the provider", 1, map.size());
- // nothing much to test
providerNetworkManagerImpl.providerRemoved(ref);
+
+ assertEquals("Error, providerRemoved() did not remove the provider", 0, map.size());
}
}
import org.opendaylight.ovsdb.schema.openvswitch.Interface;
/**
- * Unit test for class SecurityServicesImpl
+ * Unit test for {@link SecurityServicesImpl}
*/
@RunWith(MockitoJUnitRunner.class)
public class SecurityServicesImplTest {
- @Mock private Interface intf;
- @Mock private NeutronPort neutronPort;
-
@InjectMocks private SecurityServicesImpl securityServicesImpl;
- @InjectMocks private INeutronPortCRUD neutronPortCache = mock(INeutronPortCRUD.class);
+ @InjectMocks private INeutronPortCRUD neutronPortService = mock(INeutronPortCRUD.class);
+
+ @Mock Interface intf;
private List<NeutronSecurityGroup> securityGroups = new ArrayList<NeutronSecurityGroup>();
@Before
public void setUp(){
+ NeutronPort neutronPort = mock(NeutronPort.class);
+
Map<String, String> externalIds =new HashMap<String, String>();
externalIds.put(Constants.EXTERNAL_ID_INTERFACE_ID, "mapValue");
Column<GenericTableSchema, Map<String, String>> columnMock = mock(Column.class);
securityGroups.add(mock(NeutronSecurityGroup.class));
- // configure interface
when(intf.getExternalIdsColumn()).thenReturn(columnMock);
when(columnMock.getData()).thenReturn(externalIds);
- // configure neutronPort
when(neutronPort.getSecurityGroups()).thenReturn(securityGroups);
- when(neutronPortCache.getPort(anyString())).thenReturn(neutronPort);
+ when(neutronPort.getDeviceOwner()).thenReturn("deviceOwner");
+ when(neutronPortService.getPort(anyString())).thenReturn(neutronPort);
}
/**
*/
@Test
public void testIsPortSecurityReady(){
- // configure neutronPort
- when(neutronPort.getDeviceOwner()).thenReturn("deviceOwner");
-
- //test
assertTrue("Error, did not return expected boolean for isPortSecurityReady", securityServicesImpl.isPortSecurityReady(intf));
}
*/
@Test
public void testSecurityGroupInPort(){
- // test
assertEquals("Error, did not return the good neutronSecurityGroup of securityGroups", securityGroups.toArray()[0], securityServicesImpl.getSecurityGroupInPort(intf));
}
}
import static org.mockito.Matchers.same;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.opendaylight.ovsdb.openstack.netvirt.api.NetworkingProviderManager;
import org.opendaylight.ovsdb.openstack.netvirt.api.VlanConfigurationCache;
import org.opendaylight.ovsdb.plugin.api.OvsdbConfigurationService;
+import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
import org.opendaylight.ovsdb.plugin.api.Status;
import org.opendaylight.ovsdb.schema.openvswitch.Bridge;
import org.opendaylight.ovsdb.schema.openvswitch.Interface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
/**
- * Unit test for class TenantNetworkManagerImpl
+ * Unit test for {@link TenantNetworkManagerImpl}
*/
@RunWith(MockitoJUnitRunner.class)
public class TenantNetworkManagerImplTest {
@Mock private INeutronPortCRUD neutronCache;
@Mock private OvsdbConfigurationService ovsdbConfigurationService;
@Mock private NetworkingProviderManager networkingProviderManager;
+ @Mock private OvsdbConnectionService ovsdbConnectionService;
@InjectMocks private TenantNetworkManagerImpl tenantNetworkManagerImpl;
@InjectMocks private INeutronPortCRUD neutronPortCache = mock(INeutronPortCRUD.class);
*/
@Test
public void testGetInternalVlan() {
- // configure vlanConfigurationCache
when(vlanConfigurationCache.getInternalVlan(any(Node.class), eq(NETWORK_ID))).thenReturn(10);
- // test on an existing internal vlan
assertEquals("Error, did not return the correct internalVlan" , 10, tenantNetworkManagerImpl.getInternalVlan(mock(Node.class), NETWORK_ID));
- // test on a missing internal vlan
assertEquals("Error, did not return the correct internalVlan", 0, tenantNetworkManagerImpl.getInternalVlan(mock(Node.class), "unexistingNetwork"));
+
+ verify(vlanConfigurationCache, times(2)).getInternalVlan(any(Node.class), anyString());
}
/**
*/
@Test
public void testReclaimInternalVlan() {
- // configure vlanConfigurationCache
when(vlanConfigurationCache.reclaimInternalVlan(any(Node.class), eq(NETWORK_ID))).thenReturn(10);
- // test on an existing internal vlan
tenantNetworkManagerImpl.reclaimInternalVlan(mock(Node.class), NETWORK_ID, mock(NeutronNetwork.class));
- // test on a missing internal vlan
tenantNetworkManagerImpl.reclaimInternalVlan(mock(Node.class), "unexistingNetwork", mock(NeutronNetwork.class));
+
+ verify(vlanConfigurationCache, times(2)).reclaimInternalVlan(any(Node.class), anyString());
}
/**
GenericTableSchema tableSchema = mock(GenericTableSchema.class);
Status status = mock(Status.class);
- // configure port
when(port.getRow()).thenReturn(row);
when(port.getSchema()).thenReturn(tableSchema);
- // configure vlanConfigurationCache
when(vlanConfigurationCache.getInternalVlan(any(Node.class), anyString())).thenReturn(10);
- // configure ovsdbConfigurationService
when(ovsdbConfigurationService.createTypedRow(any(Node.class), same(Port.class))).thenReturn(port);
when(ovsdbConfigurationService.updateRow(any(Node.class), anyString(), anyString(), anyString(), any(Row.class))).thenReturn(status);
- // test
tenantNetworkManagerImpl.programInternalVlan(mock(Node.class), NETWORK_ID, mock(NeutronNetwork.class));
+
+ verify(vlanConfigurationCache, times(1)).getInternalVlan(any(Node.class), anyString());
}
/**
ArrayList<NeutronNetwork> listNeutronNetwork = new ArrayList<NeutronNetwork>();
listNeutronNetwork.add(neutronNetwork);
- // configure neutronNetwork
when(neutronNetwork.getProviderSegmentationID()).thenReturn("segId");
when(neutronNetwork.getNetworkUUID()).thenReturn("networkUUID");
when(neutronNetworkCache.getAllNetworks()).thenReturn(listNeutronNetwork);
- // test method getNetworkId
assertEquals("Error, did not return the UUID of the correct network", listNeutronNetwork.get(0).getNetworkUUID(), tenantNetworkManagerImpl.getNetworkId("segId"));
- // configure networkingProvider
when(networkingProviderManager.getProvider(any(Node.class))).thenReturn(networkingProvider);
when(networkingProvider.hasPerTenantTunneling()).thenReturn(true);
- // configure vlanConfigurationCache
when(vlanConfigurationCache.getInternalVlan(any(Node.class), anyString())).thenReturn(10);
- // configure ovsdbConfigurationService
when(ovsdbConfigurationService.getRows(any(Node.class), anyString())).thenReturn(map);
when(ovsdbConfigurationService.getTypedRow(any(Node.class), same(Interface.class),
any(Row.class))).thenReturn(intf);
- // configure interface
when(intf.getExternalIdsColumn()).thenReturn(columnMock);
when(columnMock.getData()).thenReturn(externalIds);
- // configure neutronPort
when(neutronPortCache.getPort(anyString())).thenReturn(neutronPort);
when(neutronPort.getNetworkUUID()).thenReturn("networkUUID");
- // test method isTenantNetworkPresentInNode
assertTrue("Error, did not return correct boolean for isTenantNetworkPresentInNode", tenantNetworkManagerImpl.isTenantNetworkPresentInNode(mock(Node.class), "segId"));
+
+
+ verify(networkingProviderManager, times(1)).getProvider(any(Node.class));
+ verify(vlanConfigurationCache, times(1)).getInternalVlan(any(Node.class), anyString());
}
/**
ArrayList<NeutronNetwork> listNeutronNetwork = new ArrayList<NeutronNetwork>();
listNeutronNetwork.add(neutronNetwork);
- // configure neutronNetwork
when(neutronNetwork.getProviderSegmentationID()).thenReturn("segId");
when(neutronNetwork.getNetworkUUID()).thenReturn("networkUUID");
when(neutronNetworkCache.getAllNetworks()).thenReturn(listNeutronNetwork);
assertEquals("Error, did not return the UUID of the correct network", listNeutronNetwork.get(0).getNetworkUUID(), tenantNetworkManagerImpl.getNetworkId("segId"));
+
+ verify(neutronNetworkCache, times(1)).getAllNetworks();
}
/**
NeutronPort neutronPort = mock(NeutronPort.class);
NeutronNetwork neutronNetwork = mock(NeutronNetwork.class);
- // configure interface
when(intf.getExternalIdsColumn()).thenReturn(columnMock);
when(columnMock.getData()).thenReturn(externalIds);
- // configure neutronPort
when(neutronPort.getNetworkUUID()).thenReturn("neutronUUID");
when(neutronPortCache.getPort(anyString())).thenReturn(neutronPort);
- // configure neutronNetwork
when(neutronNetworkCache.getNetwork(anyString())).thenReturn(neutronNetwork);
assertEquals("Error, did not return the correct tenant", neutronNetwork, tenantNetworkManagerImpl.getTenantNetwork(intf));
+
+ verify(neutronPortCache, times(1)).getPort(anyString());
+ verify(neutronNetworkCache, times(1)).getNetwork(anyString());
}
/**
*/
@Test
public void testNetworkCreated() {
- // configure vlanConfigurationCache
+ int numberOfNode = 10;
when(vlanConfigurationCache.assignInternalVlan(any(Node.class), anyString())).thenReturn(10);
+ List<Node> nodes = new ArrayList();
+ for (int i = 0; i<numberOfNode; i++) {
+ nodes.add(mock(Node.class));
+ }
+ when(ovsdbConnectionService.getNodes()).thenReturn(nodes);
+
+ tenantNetworkManagerImpl.networkCreated(NETWORK_ID);
+
+ verify(ovsdbConnectionService, times(1)).getNodes();
+ verify(vlanConfigurationCache, times(numberOfNode)).assignInternalVlan(any(Node.class), anyString());
+
assertEquals("Error, did not return the correct network id", 10,tenantNetworkManagerImpl.networkCreated(mock(Node.class), NETWORK_ID));
}
}
import static org.mockito.Mockito.when;
import java.util.HashSet;
-import java.util.Random;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
/**
- * Unit test for class VlanConfigurationCacheImpl
+ * Unit test for {@link VlanConfigurationCacheImpl}
*/
@RunWith(MockitoJUnitRunner.class)
public class VlanConfigurationCacheImplTest {
ovsTable = new ConcurrentHashMap<>();
ovsTable.put(NODE_UUID, row);
- ConcurrentHashMap<String, Row> portRows = ovsTable;
-
Set<Long> tags = new HashSet<Long>();
- tags.add(new Random().nextLong());
+ tags.add(Long.valueOf(1));
UUID uuid = mock(UUID.class);
Set<UUID> uuidSet = new HashSet<>();
Interface iface = mock(Interface.class);
NeutronNetwork neutronNetwork = mock(NeutronNetwork.class);
- // configure ovsdbConfigurationService
when(ovsdbConfigurationService.getRows(any(Node.class), anyString())).thenReturn(ovsTable);
- when(ovsdbConfigurationService.getRows(any(Node.class), anyString())).thenReturn(portRows);
when(ovsdbConfigurationService.getTypedRow(any(Node.class), same(Port.class), any(Row.class))).thenReturn(port);
- // configure port
when(port.getTagColumn()).thenReturn(longColumnMock);
when(longColumnMock.getData()).thenReturn(tags);
when(port.getInterfacesColumn()).thenReturn(uuidColumnMock);
when(uuidColumnMock.getData()).thenReturn(uuidSet);
- // configure ovsdbConfigurationService
when(ovsdbConfigurationService.getRow(any(Node.class), anyString(), anyString())).thenReturn(row);
when(ovsdbConfigurationService.getTypedRow(any(Node.class), same(Interface.class), any(Row.class))).thenReturn(iface);
- // configure neutronNetwork
when(tenantNetworkManagerImpl.getTenantNetwork(any(Interface.class))).thenReturn(neutronNetwork);
- when(neutronNetwork.getNetworkUUID()).thenReturn("networkUUID");
+ when(neutronNetwork.getNetworkUUID()).thenReturn(NETWORK_ID);
}
/**
*/
@Test
public void testAssignInternalVlan() {
- // test
- assertEquals("Error, did not return the correct internalVlanId (first added)", 1, (int) vlanConfigurationCacheImpl.assignInternalVlan(mock(Node.class), NETWORK_ID));
- assertEquals("Error, did not return the correct internalVlanId (second added)",2, (int) vlanConfigurationCacheImpl.assignInternalVlan(mock(Node.class), NETWORK_ID + "1"));
- }
+ assertEquals("Error, did not return the correct internalVlanId (first added)", 1, (int) vlanConfigurationCacheImpl.assignInternalVlan(any(Node.class), NETWORK_ID));
+ assertEquals("Error, did not return the correct internalVlanId (second added)", 2, (int) vlanConfigurationCacheImpl.assignInternalVlan(any(Node.class), NETWORK_ID + "1"));
+ }
/**
- * Test method {@linkp VlanConfigurationCacheImpl#reclaimInternalVlan(Node, String)}
+ * Test method {@link VlanConfigurationCacheImpl#reclaimInternalVlan(Node, String)}
*/
@Test
public void testReclaimInternalVlan(){
- // test
- assertEquals("Error, did not return the correct internalVlanId",0, (int) vlanConfigurationCacheImpl.reclaimInternalVlan(any(Node.class), NETWORK_ID));
+ assertEquals("Error, did not return the correct internalVlanId", 1, (int) vlanConfigurationCacheImpl.reclaimInternalVlan(any(Node.class), NETWORK_ID));
+ }
+
+ /**
+ * Test method {@link VlanConfigurationCacheImpl#getInternalVlan(Node, String)}
+ */
+ @Test
+ public void testGetInternalVlan(){
+ assertEquals("Error, did not return the correct internalVlan", 1, (int) vlanConfigurationCacheImpl.getInternalVlan(any(Node.class), NETWORK_ID));
}
}