From c13962554e3a3edfa88ad119861d8732a58196b7 Mon Sep 17 00:00:00 2001 From: gbrodman Date: Mon, 5 Dec 2022 16:14:53 -0500 Subject: [PATCH] Take anchor tenant tokens into account in domain check flows (#1868) These were always properly reflected in the actual creations, but when running a check flow it would still show a non-zero cost even when using an ANCHOR_TENANT allocation token. This changes it so that we accurately show the $0.00 cost. --- .../flows/domain/DomainFlowUtils.java | 8 ++- .../flows/domain/DomainCheckFlowTest.java | 19 +++++++ ...ck_allocationtoken_fee_anchor_response.xml | 52 +++++++++++++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 core/src/test/resources/google/registry/flows/domain/domain_check_allocationtoken_fee_anchor_response.xml diff --git a/core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java b/core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java index 2e4e019cf..aa59d2b11 100644 --- a/core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java +++ b/core/src/main/java/google/registry/flows/domain/DomainFlowUtils.java @@ -682,7 +682,13 @@ public class DomainFlowUtils { builder.setAvailIfSupported(true); fees = pricingLogic - .getCreatePrice(registry, domainNameString, now, years, false, allocationToken) + .getCreatePrice( + registry, + domainNameString, + now, + years, + isAnchorTenant(domainName, allocationToken, Optional.empty()), + allocationToken) .getFees(); } break; diff --git a/core/src/test/java/google/registry/flows/domain/DomainCheckFlowTest.java b/core/src/test/java/google/registry/flows/domain/DomainCheckFlowTest.java index 6d6ad9222..606e22743 100644 --- a/core/src/test/java/google/registry/flows/domain/DomainCheckFlowTest.java +++ b/core/src/test/java/google/registry/flows/domain/DomainCheckFlowTest.java @@ -188,6 +188,25 @@ class DomainCheckFlowTest extends ResourceCheckFlowTestCase + + + + Command completed successfully + + + + + example1.tld + + + example2.example + Alloc token invalid for domain + + + reserved.tld + Alloc token invalid for domain + + + + + + + example2.example + USD + create + 1 + 0.00 + + + example1.tld + USD + create + 1 + 0.00 + + + reserved.tld + USD + create + 1 + reserved + + + + + ABC-12345 + server-trid + + +