SdxL3Fib { private void withdraw(ResolvedRoute route) { synchronized (this) { IpPrefix prefix = route.prefix(); MultiPointToSinglePointIntent intent = routeIntents.remove(prefix); if (intent == null) { log.trace("SDX-L3 no intent in routeIntents to delete " + "for prefix: {}", prefix); return; } intentSynchronizer.withdraw(intent); } }  @Activate void activate(); @Deactivate void deactivate();  }
@Test public void testRouteDelete() { testRouteAdd(); IpPrefix prefix = Ip4Prefix.valueOf("1.1.1.0/24"); ResolvedRoute resRoute = new ResolvedRoute( new Route(Route.Source.STATIC, prefix, Ip4Address.valueOf(PEER1_IP)), MacAddress.valueOf(MAC1)); TrafficSelector.Builder selectorBuilder = DefaultTrafficSelector.builder(); selectorBuilder.matchEthType(Ethernet.TYPE_IPV4) .matchIPDst(prefix) .matchVlanId(VlanId.ANY); TrafficTreatment.Builder treatmentBuilder = DefaultTrafficTreatment.builder(); treatmentBuilder.setEthDst(MacAddress.valueOf(MAC1)).popVlan(); Set<ConnectPoint> ingressPoints = new HashSet<>(); ingressPoints.add(CONN_POINT2); ingressPoints.add(CONN_POINT3); ingressPoints.add(CONN_POINT4); MultiPointToSinglePointIntent addedIntent = MultiPointToSinglePointIntent.builder() .appId(APPID) .key(Key.of(prefix.toString(), APPID)) .selector(selectorBuilder.build()) .treatment(treatmentBuilder.build()) .ingressPoints(ingressPoints) .egressPoint(CONN_POINT1) .constraints(SdxL3Fib.CONSTRAINTS) .build(); reset(intentSynchronizer); intentSynchronizer.withdraw(eqExceptId(addedIntent)); replay(intentSynchronizer); routeListener.event(new RouteEvent(RouteEvent.Type.ROUTE_REMOVED, resRoute)); verify(intentSynchronizer); }