@SuppressWarnings("unchecked")
@Test
public void testUpdateNodeConnectorStatus_NoLinks() throws Exception {

    // Setup code to trigger the TopologyDataChangeEventProcessor
    InstanceIdentifier<Link> instanceId = InstanceIdentifier.create(Link.class);
    Link nodeLink = new LinkBuilder().setLinkId(new LinkId("openflow:1")).build();
    DataTreeModification<Link> mockChange = Mockito.mock(DataTreeModification.class);
    DataObjectModification<Link> mockModification = Mockito.mock(DataObjectModification.class);
    when(mockModification.getDataAfter()).thenReturn(nodeLink);
    when(mockModification.getModificationType()).thenReturn(DataObjectModification.ModificationType.WRITE);
    when(mockChange.getRootPath()).thenReturn(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL,
            instanceId));
    when(mockChange.getRootNode()).thenReturn(mockModification);
    // End setup code
    Topology topology = new TopologyBuilder().setLink(null).build();
    Optional<Topology> topologyOptional = Optional.of(topology);
    CheckedFuture checkedFuture = Mockito.mock(CheckedFuture.class);
    when(checkedFuture.get()).thenReturn(topologyOptional);
    ReadOnlyTransaction readOnlyTransaction = Mockito.mock(ReadOnlyTransaction.class);
    when(readOnlyTransaction.read(any(LogicalDatastoreType.class), any(InstanceIdentifier.class)))
            .thenReturn(checkedFuture);
    when(dataBroker.newReadOnlyTransaction()).thenReturn(readOnlyTransaction);
    topologyLinkDataChangeHandler.onDataTreeChanged(Collections.singletonList(mockChange));
    Thread.sleep(500);
    verify(dataBroker, times(0)).newReadWriteTransaction();
    verify(networkGraphService, times(0)).addLinks(any(List.class));
    verify(networkGraphService, times(0)).getAllLinks();
    verify(networkGraphService, times(0)).getLinksInMst();
}