@Test public void testVrfBuilder() { NetworkFactory nf = new NetworkFactory(); Vrf.Builder vb = nf.vrfBuilder(); Vrf v1 = vb.build(); Vrf v2 = vb.build(); Configuration c = nf.configurationBuilder().setConfigurationFormat(CONFIG_FORMAT).build(); vb.setOwner(c); Vrf v3 = vb.build(); assertThat(v1.getName(), is(notNullValue())); assertThat(v2.getName(), is(notNullValue())); assertThat(v1.getName(), not(equalTo(v2.getName()))); assertThat(c.getVrfs(), not(hasKey(v1.getName()))); assertThat(c.getVrfs(), not(hasKey(v2.getName()))); assertThat(c.getVrfs(), hasKey(v3.getName())); }
public Vrf.Builder vrfBuilder() { return Vrf.builder(() -> generateName(Vrf.class)); }
NetworkFactory { public Vrf.Builder vrfBuilder() { return Vrf.builder(() -> generateName(Vrf.class)); } }
NetworkFactory { public Vrf.Builder vrfBuilder() { return Vrf.builder(() -> generateName(Vrf.class)); } NetworkFactory(); }
NetworkFactory { public Vrf.Builder vrfBuilder() { return Vrf.builder(() -> generateName(Vrf.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 Vrf.Builder vrfBuilder() { return Vrf.builder(() -> generateName(Vrf.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();  }