@Test public void testTransformType2RouteOnImport() { final OspfExternalRoute.Builder builder = OspfExternalType2Route.builder() .setNetwork(Prefix.parse("2.2.2.2/32")) .setLsaMetric(0L) .setCostToAdvertiser(0L) .setAdvertiser("someNode") .setArea(1L) .setAdmin(0) .setNextHopIp(Ip.parse("1.1.1.1")); final Ip nextHopIp = Ip.parse("9.9.9.9"); assertThat( _routingProcess .transformType2RouteOnImport((OspfExternalType2Route) builder.build(), nextHopIp, 10) .build(), equalTo(builder.setCostToAdvertiser(10).setNextHopIp(nextHopIp).setAdmin(400).build())); }
@Nonnull @VisibleForTesting OspfExternalType2Route.Builder transformType2RouteOnImport( OspfExternalType2Route route, Ip nextHopIp, long incrementalCost) { return transformType1and2CommonOnImport(route, nextHopIp) .setCostToAdvertiser(route.getCostToAdvertiser() + incrementalCost); }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @Nonnull @VisibleForTesting OspfExternalType2Route.Builder transformType2RouteOnImport( OspfExternalType2Route route, Ip nextHopIp, long incrementalCost) { return transformType1and2CommonOnImport(route, nextHopIp) .setCostToAdvertiser(route.getCostToAdvertiser() + incrementalCost); } }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @Nonnull @VisibleForTesting OspfExternalType2Route.Builder transformType2RouteOnImport( OspfExternalType2Route route, Ip nextHopIp, long incrementalCost) { return transformType1and2CommonOnImport(route, nextHopIp) .setCostToAdvertiser(route.getCostToAdvertiser() + incrementalCost); } OspfRoutingProcess(
      OspfProcess process, String vrfName, Configuration configuration, OspfTopology topology); }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @Nonnull @VisibleForTesting OspfExternalType2Route.Builder transformType2RouteOnImport( OspfExternalType2Route route, Ip nextHopIp, long incrementalCost) { return transformType1and2CommonOnImport(route, nextHopIp) .setCostToAdvertiser(route.getCostToAdvertiser() + incrementalCost); } OspfRoutingProcess(
      OspfProcess process, String vrfName, Configuration configuration, OspfTopology topology); @Override void initialize(Node n); @Override void executeIteration(Map<String, Node> allNodes); @Override void updateTopology(OspfTopology topology); @Nonnull @Override RibDelta<OspfRoute> getUpdatesForMainRib(); @Override void redistribute(RibDelta<? extends AnnotatedRoute<AbstractRoute>> mainRibDelta); @Override boolean isDirty(); }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @Nonnull @VisibleForTesting OspfExternalType2Route.Builder transformType2RouteOnImport( OspfExternalType2Route route, Ip nextHopIp, long incrementalCost) { return transformType1and2CommonOnImport(route, nextHopIp) .setCostToAdvertiser(route.getCostToAdvertiser() + incrementalCost); } OspfRoutingProcess(
      OspfProcess process, String vrfName, Configuration configuration, OspfTopology topology); @Override void initialize(Node n); @Override void executeIteration(Map<String, Node> allNodes); @Override void updateTopology(OspfTopology topology); @Nonnull @Override RibDelta<OspfRoute> getUpdatesForMainRib(); @Override void redistribute(RibDelta<? extends AnnotatedRoute<AbstractRoute>> mainRibDelta); @Override boolean isDirty();  }