From bee77f0cc3baaf491675e8620c9faac2e9e84ac9 Mon Sep 17 00:00:00 2001 From: jianglai Date: Fri, 13 Apr 2018 09:17:16 -0700 Subject: [PATCH] Make domain check return availability regardless of fee extensions This allows a registrar to check domain availability even if the fee extension is not set. To obtain the premium price or create the domain, the fee extension is still needed. PS: I believe the previous tests are erroneous anyway. It is the presence of fee extensions in the check request that we were looking for. Checking if the extension is declared during login has no bearing on the results. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=192778137 --- .../flows/domain/DomainCheckFlow.java | 7 ------- .../flows/domain/DomainCheckFlowTest.java | 21 ++----------------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/java/google/registry/flows/domain/DomainCheckFlow.java b/java/google/registry/flows/domain/DomainCheckFlow.java index f1877da8c..fbb197245 100644 --- a/java/google/registry/flows/domain/DomainCheckFlow.java +++ b/java/google/registry/flows/domain/DomainCheckFlow.java @@ -26,7 +26,6 @@ import static google.registry.flows.domain.DomainFlowUtils.verifyNotInPredelegat import static google.registry.model.EppResourceUtils.checkResourcesExist; import static google.registry.model.index.DomainApplicationIndex.loadActiveApplicationsByDomainName; import static google.registry.model.registry.label.ReservationType.getTypeOfHighestSeverity; -import static google.registry.pricing.PricingEngineProxy.isDomainPremium; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -199,12 +198,6 @@ public final class DomainCheckFlow implements Flow { return Optional.of("Pending allocation"); } ImmutableSet reservationTypes = getReservationTypes(domainName); - if (reservationTypes.isEmpty() - && isDomainPremium(domainName.toString(), now) - && registry.getPremiumPriceAckRequired() - && !eppInput.getSingleExtension(FeeCheckCommandExtension.class).isPresent()) { - return Optional.of("Premium names require EPP ext."); - } if (!reservationTypes.isEmpty()) { return Optional.of(getTypeOfHighestSeverity(reservationTypes).getMessageForCheck()); } diff --git a/javatests/google/registry/flows/domain/DomainCheckFlowTest.java b/javatests/google/registry/flows/domain/DomainCheckFlowTest.java index 1e7b48188..01bcb53a4 100644 --- a/javatests/google/registry/flows/domain/DomainCheckFlowTest.java +++ b/javatests/google/registry/flows/domain/DomainCheckFlowTest.java @@ -460,28 +460,11 @@ public class DomainCheckFlowTest create(true, "example3.tld", null)); } - /** - * Test that premium names are shown as unavailable if the premium pricing extension is not - * declared at login. - */ + /** Test that premium names are shown as available even if the fee extension is not used. */ @Test - public void testAvailExtension_premiumDomainsAreUnavailableWithoutExtension() throws Exception { - sessionMetadata.setServiceExtensionUris(ImmutableSet.of()); + public void testAvailExtension_premiumDomainsAreAvailableWithoutExtension() throws Exception { createTld("example"); setEppInput("domain_check_premium.xml"); - doCheckTest(create(false, "rich.example", "Premium names require EPP ext.")); - } - - /** - * Test that premium names are always shown as available if the TLD does not require the premium - * pricing extension to register premium names. - */ - @Test - public void testAvailExtension_premiumDomainsAvailableIfNotRequiredByTld() throws Exception { - sessionMetadata.setServiceExtensionUris(ImmutableSet.of()); - createTld("example"); - persistResource(Registry.get("example").asBuilder().setPremiumPriceAckRequired(false).build()); - setEppInput("domain_check_premium.xml"); doCheckTest(create(true, "rich.example", null)); }