@Test
public void testDispatchPacket_noDispatch() throws Exception {

    InstanceIdentifier<NodeConnector> ncInsId = InstanceIdentifier.builder(Nodes.class)
            .child(Node.class, new NodeKey(new NodeId("1")))
            .child(NodeConnector.class, new NodeConnectorKey(new NodeConnectorId("1"))).build();
    HashMap<String, NodeConnectorRef> controllerSwitchConnectors = Mockito.mock(HashMap.class);
    when(controllerSwitchConnectors.get(any(String.class))).thenReturn(null);
    when(inventoryReader.getControllerSwitchConnectors()).thenReturn(controllerSwitchConnectors);
    packetDispatcher.dispatchPacket(null, new NodeConnectorRef(ncInsId), null, null);
    verify(inventoryReader, times(2)).readInventory();
    verify(inventoryReader, times(1)).setRefreshData(true);
    verify(packetProcessingService, times(0)).transmitPacket(any(TransmitPacketInput.class));
}