TunnellingConnectivityManager implements Ipv4PacketListener { public void notifySwitchAvailable() { checkNotNull(flowObjectivesService, "FlowObjectivesService in DIDM not initialized"); checkNotNull(bgpSpeaker); NodeRef nodeRef = new NodeRef(InstanceIdentifier.builder(Nodes.class) .child(Node.class, new NodeKey(bgpSpeaker.getAttachmentDpId())).build()); try { Thread.sleep(2000); } catch (Exception ex) { } ForwardingObjective forwardingObjSrc = generateForwardingObjective(true); ForwardInputBuilder forwardInputBuilderSrc = new ForwardInputBuilder(); forwardInputBuilderSrc.setNode(nodeRef); forwardInputBuilderSrc.setForwardingObjective(forwardingObjSrc); flowObjectivesService.forward(forwardInputBuilderSrc.build()); ForwardingObjective forwardingObjDest = generateForwardingObjective(false); ForwardInputBuilder forwardInputBuilderDest = new ForwardInputBuilder(); forwardInputBuilderDest.setNode(nodeRef); forwardInputBuilderDest.setForwardingObjective(forwardingObjDest); flowObjectivesService.forward(forwardInputBuilderDest.build()); LOG.info("Punt to controller for BGP packets sent"); } TunnellingConnectivityManager(DataBroker dataBroker, RoutingConfigService configService,
			PacketProcessingService packetService, AtriumFlowObjectiveService flowObjectives); void start(); void stop(); void notifySwitchAvailable(); @Override void onIpv4PacketReceived(Ipv4PacketReceived packetReceived);  }
@Test public void testNotifySwitchAvailable() { connectivityManager.notifySwitchAvailable(); verify(flowObjectives, times(2)).forward(any(ForwardInput.class)); }