nacx commented on this pull request.
> + */ +package org.jclouds.azurecompute.arm.domain; + +import java.util.List; + +import org.jclouds.javax.annotation.Nullable; +import org.jclouds.json.SerializedNames; + +import com.google.auto.value.AutoValue; +import com.google.common.collect.ImmutableList; + +@AutoValue +public abstract class IpAddressAvailabilityResult { + public abstract boolean available(); + + @Nullable You enforce presence in the `create` method so this will never return null. Remove the annotation. > VirtualNetwork vn = api().createOrUpdate(virtualNetworkName, LOCATION, null, virtualNetworkProperties); + resourceAvailable.apply(new Supplier<Provisionable>() { + @Override + public Provisionable get() { + VirtualNetwork updated = api().get(virtualNetworkName); + return updated == null ? null : updated.properties(); + } + }); There is already a [NetworkAvailablePredicate](https://github.com/jclouds/jclouds/blob/master/providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/config/AzurePredicatesModule.java#L150); ad it to the base test class predicates and use it here instead. > @@ -73,4 +74,11 @@ VirtualNetwork > createOrUpdate(@PathParam("virtualnetworkname") String virtualnet @DELETE @ResponseParser(FalseOn204.class) boolean delete(@PathParam("virtualnetworkname") String virtualnetworkname); + + @Named("virtualnetwork:check_ip_address_availability") + @Path("/{virtualnetworkname}/CheckIPAddressAvailability") + @GET + @Fallback(NullOnNotFoundOr404.class) If the virtual network does not exist, let's throw an exception. Returning `null` on a check method is confusing. Let's better remove this fallback and let jclouds throw the default exception upon a 4xx response. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/1231#pullrequestreview-136813199