@Test public void testOspfAreaBuilder() { NetworkFactory nf = new NetworkFactory(); Configuration c = nf.configurationBuilder().setConfigurationFormat(CONFIG_FORMAT).build(); Vrf vrf = nf.vrfBuilder().setOwner(c).build(); OspfProcess.Builder ob = nf.ospfProcessBuilder(); OspfProcess ospfProcess = ob.setVrf(vrf).setRouterId(Ip.ZERO).build(); OspfArea.Builder oab = nf.ospfAreaBuilder(); OspfArea oa1 = oab.build(); OspfArea oa2 = oab.setOspfProcess(ospfProcess).build(); Interface iface = nf.interfaceBuilder() .setOwner(c) .setActive(false) .setVrf(vrf) .setOspfSettings( OspfInterfaceSettings.defaultSettingsBuilder() .setAreaName(oa2.getAreaNumber()) .build()) .build(); oa2.addInterface(iface.getName()); assertThat(oa1.getAreaNumber(), not(equalTo(oa2.getAreaNumber()))); assertThat(oa1, not(sameInstance(oa2))); assertThat(ospfProcess.getAreas().get(oa2.getAreaNumber()), sameInstance(oa2)); assertThat(oa2, OspfAreaMatchers.hasInterfaces(hasItem(iface.getName()))); assertThat(iface.getOspfAreaName(), equalTo(oa2.getAreaNumber())); }
public OspfArea.Builder ospfAreaBuilder() { return OspfArea.builder(() -> generateLong(OspfArea.class)); }
NetworkFactory { public OspfArea.Builder ospfAreaBuilder() { return OspfArea.builder(() -> generateLong(OspfArea.class)); } }
NetworkFactory { public OspfArea.Builder ospfAreaBuilder() { return OspfArea.builder(() -> generateLong(OspfArea.class)); } NetworkFactory(); }
NetworkFactory { public OspfArea.Builder ospfAreaBuilder() { return OspfArea.builder(() -> generateLong(OspfArea.class)); } NetworkFactory(); IpAccessList.Builder aclBuilder(); BgpActivePeerConfig.Builder bgpNeighborBuilder(); BgpPassivePeerConfig.Builder bgpDynamicNeighborBuilder(); BgpProcess.Builder bgpProcessBuilder(); Configuration.Builder configurationBuilder(); Interface.Builder interfaceBuilder(); OspfArea.Builder ospfAreaBuilder(); OspfProcess.Builder ospfProcessBuilder(); RipProcess.Builder ripProcessBuilder(); @VisibleForTesting RoutingPolicy.Builder routingPolicyBuilder(); Vrf.Builder vrfBuilder(); }
NetworkFactory { public OspfArea.Builder ospfAreaBuilder() { return OspfArea.builder(() -> generateLong(OspfArea.class)); } NetworkFactory(); IpAccessList.Builder aclBuilder(); BgpActivePeerConfig.Builder bgpNeighborBuilder(); BgpPassivePeerConfig.Builder bgpDynamicNeighborBuilder(); BgpProcess.Builder bgpProcessBuilder(); Configuration.Builder configurationBuilder(); Interface.Builder interfaceBuilder(); OspfArea.Builder ospfAreaBuilder(); OspfProcess.Builder ospfProcessBuilder(); RipProcess.Builder ripProcessBuilder(); @VisibleForTesting RoutingPolicy.Builder routingPolicyBuilder(); Vrf.Builder vrfBuilder();  }