@Test public void testTransformType1RouteOnImport() { final OspfExternalRoute.Builder builder = OspfExternalType1Route.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 .transformType1RouteOnImport((OspfExternalType1Route) builder.build(), nextHopIp, 10) .build(), equalTo( builder .setCostToAdvertiser(10) .setMetric(10) .setNextHopIp(nextHopIp) .setAdmin(300) .build())); }
@Nonnull @VisibleForTesting OspfExternalType1Route.Builder transformType1RouteOnImport( OspfExternalType1Route route, Ip nextHopIp, long incrementalCost) { return transformType1and2CommonOnImport(route, nextHopIp) .setCostToAdvertiser(route.getCostToAdvertiser() + incrementalCost) .setMetric(route.getMetric() + incrementalCost); }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @Nonnull @VisibleForTesting OspfExternalType1Route.Builder transformType1RouteOnImport( OspfExternalType1Route route, Ip nextHopIp, long incrementalCost) { return transformType1and2CommonOnImport(route, nextHopIp) .setCostToAdvertiser(route.getCostToAdvertiser() + incrementalCost) .setMetric(route.getMetric() + incrementalCost); } }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @Nonnull @VisibleForTesting OspfExternalType1Route.Builder transformType1RouteOnImport( OspfExternalType1Route route, Ip nextHopIp, long incrementalCost) { return transformType1and2CommonOnImport(route, nextHopIp) .setCostToAdvertiser(route.getCostToAdvertiser() + incrementalCost) .setMetric(route.getMetric() + incrementalCost); } OspfRoutingProcess(
      OspfProcess process, String vrfName, Configuration configuration, OspfTopology topology); }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @Nonnull @VisibleForTesting OspfExternalType1Route.Builder transformType1RouteOnImport( OspfExternalType1Route route, Ip nextHopIp, long incrementalCost) { return transformType1and2CommonOnImport(route, nextHopIp) .setCostToAdvertiser(route.getCostToAdvertiser() + incrementalCost) .setMetric(route.getMetric() + 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 OspfExternalType1Route.Builder transformType1RouteOnImport( OspfExternalType1Route route, Ip nextHopIp, long incrementalCost) { return transformType1and2CommonOnImport(route, nextHopIp) .setCostToAdvertiser(route.getCostToAdvertiser() + incrementalCost) .setMetric(route.getMetric() + 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();  }