Remove UNRESERVED as a reservation type

This is a follow-up to Lai's refactoring of the get reservation types
code to return a set rather than a single type. Since we're always
returning a set now, the more natural way to represent a label that is
not reserved is to return an empty set rather than a set containing
UNRESERVED.

Also fixes some minor style issues I ran across regarding static
importing and test method naming that I ran across (no logic
implications).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151132116
This commit is contained in:
mcilwain 2017-03-24 09:09:06 -07:00 committed by Ben McIlwain
parent 4260fb573f
commit b03bd3b525
12 changed files with 83 additions and 90 deletions

View file

@ -26,7 +26,9 @@ import static google.registry.model.EppResourceUtils.loadByForeignKey;
import static google.registry.model.domain.DomainResource.MAX_REGISTRATION_YEARS;
import static google.registry.model.ofy.ObjectifyService.ofy;
import static google.registry.model.registry.Registries.findTldForName;
import static google.registry.model.registry.label.ReservationType.FULLY_BLOCKED;
import static google.registry.model.registry.label.ReservationType.NAMESERVER_RESTRICTED;
import static google.registry.model.registry.label.ReservationType.RESERVED_FOR_ANCHOR_TENANT;
import static google.registry.model.registry.label.ReservedList.getAllowedNameservers;
import static google.registry.pricing.PricingEngineProxy.isDomainPremium;
import static google.registry.tldconfig.idn.IdnLabelValidator.findValidIdnTableForTld;
@ -391,8 +393,8 @@ public class DomainFlowUtils {
private static boolean isReserved(InternetDomainName domainName, boolean isSunrise) {
ImmutableSet<ReservationType> types = getReservationTypes(domainName);
return types.contains(ReservationType.FULLY_BLOCKED)
|| types.contains(ReservationType.RESERVED_FOR_ANCHOR_TENANT)
return types.contains(FULLY_BLOCKED)
|| types.contains(RESERVED_FOR_ANCHOR_TENANT)
|| !(isSunrise || intersection(TYPES_ALLOWED_FOR_CREATE_ONLY_IN_SUNRISE, types).isEmpty());
}