@Test
public void testDeviceIndex() throws Exception {

    EnumSet<IDeviceService.DeviceField> indexFields =
            EnumSet.noneOf(IDeviceService.DeviceField.class);
    indexFields.add(IDeviceService.DeviceField.IPV4);
    indexFields.add(IDeviceService.DeviceField.VLAN);
    deviceManager.addIndex(false, indexFields);
    ITopologyService mockTopology = createMock(ITopologyService.class);
    deviceManager.topology = mockTopology;
    expect(mockTopology.isAttachmentPointPort(anyLong(),
                                              anyShort())).
                                              andReturn(true).anyTimes();
    expect(mockTopology.getL2DomainId(EasyMock.anyLong())).andReturn(1L).anyTimes();
    replay(mockTopology);
    doTestDeviceQuery();
}