@Test public void testGetEnabledTargetZones() { AvailabilityZone myAz = new AvailabilityZone("s", "az1"); AvailabilityZone otherAz = new AvailabilityZone("s", "az2"); List<AvailabilityZone> allAzs = ImmutableList.of(myAz, otherAz); assertThat( getEnabledTargetZones(myAz, false, allAzs), equalTo(ImmutableSet.of(myAz.getZoneName()))); assertThat( getEnabledTargetZones(myAz, true, allAzs), equalTo(ImmutableSet.of(myAz.getZoneName(), otherAz.getZoneName()))); }
@VisibleForTesting static Set<String> getEnabledTargetZones( AvailabilityZone instanceZone, boolean crossZoneLoadBalancing, List<AvailabilityZone> allEnabledZones) { return crossZoneLoadBalancing ? allEnabledZones.stream() .map(zone -> zone.getZoneName()) .collect(ImmutableSet.toImmutableSet()) : ImmutableSet.of(instanceZone.getZoneName()); }
LoadBalancer implements AwsVpcEntity, Serializable { @VisibleForTesting static Set<String> getEnabledTargetZones( AvailabilityZone instanceZone, boolean crossZoneLoadBalancing, List<AvailabilityZone> allEnabledZones) { return crossZoneLoadBalancing ? allEnabledZones.stream() .map(zone -> zone.getZoneName()) .collect(ImmutableSet.toImmutableSet()) : ImmutableSet.of(instanceZone.getZoneName()); } }
LoadBalancer implements AwsVpcEntity, Serializable { @VisibleForTesting static Set<String> getEnabledTargetZones( AvailabilityZone instanceZone, boolean crossZoneLoadBalancing, List<AvailabilityZone> allEnabledZones) { return crossZoneLoadBalancing ? allEnabledZones.stream() .map(zone -> zone.getZoneName()) .collect(ImmutableSet.toImmutableSet()) : ImmutableSet.of(instanceZone.getZoneName()); } LoadBalancer(
      String arn,
      List<AvailabilityZone> availabilityZones,
      String dnsName,
      String name,
      Scheme scheme,
      Type type,
      String vpcId); }
LoadBalancer implements AwsVpcEntity, Serializable { @VisibleForTesting static Set<String> getEnabledTargetZones( AvailabilityZone instanceZone, boolean crossZoneLoadBalancing, List<AvailabilityZone> allEnabledZones) { return crossZoneLoadBalancing ? allEnabledZones.stream() .map(zone -> zone.getZoneName()) .collect(ImmutableSet.toImmutableSet()) : ImmutableSet.of(instanceZone.getZoneName()); } LoadBalancer(
      String arn,
      List<AvailabilityZone> availabilityZones,
      String dnsName,
      String name,
      Scheme scheme,
      Type type,
      String vpcId); @Override String getId(); @Nonnull List<AvailabilityZone> getAvailabilityZones(); @Nonnull String getDnsName(); @Nonnull String getName(); @Nonnull Scheme getScheme(); @Nonnull Type getType(); @Nonnull String getVpcId(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
LoadBalancer implements AwsVpcEntity, Serializable { @VisibleForTesting static Set<String> getEnabledTargetZones( AvailabilityZone instanceZone, boolean crossZoneLoadBalancing, List<AvailabilityZone> allEnabledZones) { return crossZoneLoadBalancing ? allEnabledZones.stream() .map(zone -> zone.getZoneName()) .collect(ImmutableSet.toImmutableSet()) : ImmutableSet.of(instanceZone.getZoneName()); } LoadBalancer(
      String arn,
      List<AvailabilityZone> availabilityZones,
      String dnsName,
      String name,
      Scheme scheme,
      Type type,
      String vpcId); @Override String getId(); @Nonnull List<AvailabilityZone> getAvailabilityZones(); @Nonnull String getDnsName(); @Nonnull String getName(); @Nonnull Scheme getScheme(); @Nonnull Type getType(); @Nonnull String getVpcId(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }