diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckCommandExtensionItemStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckCommandExtensionItemStdV1.java
index fb74aa5a72e..8780f8a48f5 100644
--- a/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckCommandExtensionItemStdV1.java
+++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckCommandExtensionItemStdV1.java
@@ -18,7 +18,6 @@
import google.registry.model.domain.Period;
import google.registry.model.domain.fee.FeeCheckCommandExtensionItem;
import jakarta.xml.bind.annotation.XmlAttribute;
-import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;
import java.util.Locale;
import java.util.Optional;
@@ -32,12 +31,13 @@
*
{@code
*
* 1
- * premium
- * 2017-05-17T13:22:21.0Z
*
* }
+ *
+ * The `feeClass` and `feeDate` attributes that are present in version 0.12 are removed from
+ * this version.
*/
-@XmlType(propOrder = {"period", "feeClass", "feeDate"})
+@XmlType(propOrder = {"period"})
public class FeeCheckCommandExtensionItemStdV1 extends FeeCheckCommandExtensionItem {
/** The default validity period (if not specified) is 1 year for all operations. */
@@ -50,12 +50,6 @@ public class FeeCheckCommandExtensionItemStdV1 extends FeeCheckCommandExtensionI
@XmlAttribute String subphase;
- @XmlElement(name = "class")
- String feeClass;
-
- @XmlElement(name = "date")
- DateTime feeDate;
-
/** Version 1.0 does not support domain name or currency in fee extension items. */
@Override
public boolean isDomainNameSupported() {
@@ -107,6 +101,6 @@ public FeeCheckResponseExtensionItemStdV1.Builder createResponseBuilder() {
@Override
public Optional getEffectiveDate() {
- return Optional.ofNullable(feeDate);
+ return Optional.empty();
}
}
diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionItemCommandStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionItemCommandStdV1.java
index 8571dcf3dc6..60719760e5f 100644
--- a/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionItemCommandStdV1.java
+++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionItemCommandStdV1.java
@@ -30,7 +30,7 @@
import org.joda.time.DateTime;
/** The version 1.0 response command entity for a domain check on a single resource. */
-@XmlType(propOrder = {"period", "fee", "feeClass", "effectiveDate", "notAfterDate"})
+@XmlType(propOrder = {"period", "fee", "feeClass"})
public class FeeCheckResponseExtensionItemCommandStdV1 extends ImmutableObject {
/** The command that was checked. */
@@ -61,14 +61,6 @@ public class FeeCheckResponseExtensionItemCommandStdV1 extends ImmutableObject {
@XmlElement(name = "class")
String feeClass;
- /** The effective date that the check is to be performed on (if specified in the query). */
- @XmlElement(name = "date")
- DateTime effectiveDate;
-
- /** The date after which the quoted fee is no longer valid (if applicable). */
- @XmlElement(name = "notAfter")
- DateTime notAfterDate;
-
public String getFeeClass() {
return feeClass;
}
@@ -96,16 +88,6 @@ public Builder setPeriod(Period period) {
return this;
}
- public Builder setEffectiveDate(DateTime effectiveDate) {
- getInstance().effectiveDate = effectiveDate;
- return this;
- }
-
- public Builder setNotAfterDate(DateTime notAfterDate) {
- getInstance().notAfterDate = notAfterDate;
- return this;
- }
-
public Builder setFee(List fees) {
getInstance().fee = forceEmptyToNull(ImmutableList.copyOf(fees));
return this;
diff --git a/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionItemStdV1.java b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionItemStdV1.java
index cbbd9530a74..059c37f3915 100644
--- a/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionItemStdV1.java
+++ b/core/src/main/java/google/registry/model/domain/feestdv1/FeeCheckResponseExtensionItemStdV1.java
@@ -17,7 +17,6 @@
import static google.registry.util.CollectionUtils.forceEmptyToNull;
import com.google.common.collect.ImmutableList;
-import google.registry.model.domain.DomainObjectSpec;
import google.registry.model.domain.Period;
import google.registry.model.domain.fee.Fee;
import google.registry.model.domain.fee.FeeCheckResponseExtensionItem;
@@ -26,11 +25,11 @@
import org.joda.time.DateTime;
/** The version 1.0 response for a domain check on a single resource. */
-@XmlType(propOrder = {"object", "command"})
+@XmlType(propOrder = {"objID", "command"})
public class FeeCheckResponseExtensionItemStdV1 extends FeeCheckResponseExtensionItem {
/** The domain that was checked. */
- DomainObjectSpec object;
+ String objID;
/** The command that was checked. */
FeeCheckResponseExtensionItemCommandStdV1 command;
@@ -97,7 +96,7 @@ public Builder setClass(String feeClass) {
@Override
public Builder setDomainNameIfSupported(String name) {
- getInstance().object = new DomainObjectSpec(name);
+ getInstance().objID = name;
return this;
}
@@ -106,17 +105,5 @@ public FeeCheckResponseExtensionItemStdV1 build() {
getInstance().command = commandBuilder.build();
return super.build();
}
-
- @Override
- public Builder setEffectiveDateIfSupported(DateTime effectiveDate) {
- commandBuilder.setEffectiveDate(effectiveDate);
- return this;
- }
-
- @Override
- public Builder setNotAfterDateIfSupported(DateTime notAfterDate) {
- commandBuilder.setNotAfterDate(notAfterDate);
- return this;
- }
}
}
diff --git a/core/src/main/java/google/registry/model/eppcommon/ProtocolDefinition.java b/core/src/main/java/google/registry/model/eppcommon/ProtocolDefinition.java
index ccff560ed6a..5b57b59bc2f 100644
--- a/core/src/main/java/google/registry/model/eppcommon/ProtocolDefinition.java
+++ b/core/src/main/java/google/registry/model/eppcommon/ProtocolDefinition.java
@@ -56,7 +56,7 @@ public enum ServiceExtension {
FEE_0_6(FeeCheckCommandExtensionV06.class, FeeCheckResponseExtensionV06.class, true),
FEE_0_11(FeeCheckCommandExtensionV11.class, FeeCheckResponseExtensionV11.class, true),
FEE_0_12(FeeCheckCommandExtensionV12.class, FeeCheckResponseExtensionV12.class, true),
- FEE_1_00(FeeCheckCommandExtensionStdV1.class, FeeCheckResponseExtensionStdV1.class, false),
+ FEE_1_00(FeeCheckCommandExtensionStdV1.class, FeeCheckResponseExtensionStdV1.class, true),
METADATA_1_0(MetadataExtension.class, null, false);
private final Class extends CommandExtension> commandExtensionClass;
diff --git a/core/src/main/java/google/registry/xml/xsd/fee-std-v1.xsd b/core/src/main/java/google/registry/xml/xsd/fee-std-v1.xsd
index 94adaafd284..33e1d41e0c0 100644
--- a/core/src/main/java/google/registry/xml/xsd/fee-std-v1.xsd
+++ b/core/src/main/java/google/registry/xml/xsd/fee-std-v1.xsd
@@ -23,7 +23,7 @@
-
+
@@ -33,32 +33,24 @@
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
@@ -66,47 +58,13 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
+
-
-
-
@@ -121,32 +79,15 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ minOccurs="0" maxOccurs="unbounded" />
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
@@ -186,9 +167,10 @@
+
-
+
@@ -204,6 +186,7 @@
+
diff --git a/core/src/test/java/google/registry/flows/FlowTestCase.java b/core/src/test/java/google/registry/flows/FlowTestCase.java
index bb485939cc8..4a26ff908bd 100644
--- a/core/src/test/java/google/registry/flows/FlowTestCase.java
+++ b/core/src/test/java/google/registry/flows/FlowTestCase.java
@@ -36,6 +36,7 @@
import google.registry.flows.picker.FlowPicker;
import google.registry.model.billing.BillingBase;
import google.registry.model.domain.GracePeriod;
+import google.registry.model.eppcommon.EppXmlTransformer;
import google.registry.model.eppcommon.ProtocolDefinition;
import google.registry.model.eppinput.EppInput;
import google.registry.model.eppoutput.EppOutput;
@@ -289,6 +290,8 @@ public EppOutput runFlowAssertResponse(
if (output.isResponse()) {
assertThat(output.isSuccess()).isTrue();
}
+ // Verify that expected xml is syntatically correct.
+ EppXmlTransformer.validateOutput(xml);
try {
assertXmlEquals(
xml, new String(marshal(output, ValidationMode.STRICT), UTF_8), ignoredPathsPlusTrid);
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 c2b9ac8ae58..e9e26cddedd 100644
--- a/core/src/test/java/google/registry/flows/domain/DomainCheckFlowTest.java
+++ b/core/src/test/java/google/registry/flows/domain/DomainCheckFlowTest.java
@@ -14,32 +14,6 @@
package google.registry.flows.domain;
-import static google.registry.bsa.persistence.BsaTestingUtils.persistBsaLabel;
-import static google.registry.model.billing.BillingBase.RenewalPriceBehavior.DEFAULT;
-import static google.registry.model.billing.BillingBase.RenewalPriceBehavior.NONPREMIUM;
-import static google.registry.model.billing.BillingBase.RenewalPriceBehavior.SPECIFIED;
-import static google.registry.model.domain.token.AllocationToken.TokenType.DEFAULT_PROMO;
-import static google.registry.model.domain.token.AllocationToken.TokenType.REGISTER_BSA;
-import static google.registry.model.domain.token.AllocationToken.TokenType.SINGLE_USE;
-import static google.registry.model.domain.token.AllocationToken.TokenType.UNLIMITED_USE;
-import static google.registry.model.eppoutput.CheckData.DomainCheck.create;
-import static google.registry.model.tld.Tld.TldState.PREDELEGATION;
-import static google.registry.model.tld.Tld.TldState.START_DATE_SUNRISE;
-import static google.registry.testing.DatabaseHelper.createTld;
-import static google.registry.testing.DatabaseHelper.createTlds;
-import static google.registry.testing.DatabaseHelper.loadRegistrar;
-import static google.registry.testing.DatabaseHelper.persistActiveDomain;
-import static google.registry.testing.DatabaseHelper.persistBillingRecurrenceForDomain;
-import static google.registry.testing.DatabaseHelper.persistDeletedDomain;
-import static google.registry.testing.DatabaseHelper.persistPremiumList;
-import static google.registry.testing.DatabaseHelper.persistReservedList;
-import static google.registry.testing.DatabaseHelper.persistResource;
-import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
-import static google.registry.util.DateTimeUtils.START_OF_TIME;
-import static org.joda.money.CurrencyUnit.JPY;
-import static org.joda.money.CurrencyUnit.USD;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
@@ -86,10 +60,6 @@
import google.registry.model.tld.Tld.TldState;
import google.registry.model.tld.label.ReservedList;
import google.registry.testing.DatabaseHelper;
-import java.math.BigDecimal;
-import java.util.Map;
-import java.util.Optional;
-import java.util.stream.Stream;
import org.joda.money.Money;
import org.joda.time.DateTime;
import org.junit.jupiter.api.BeforeEach;
@@ -99,6 +69,37 @@
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
+import java.math.BigDecimal;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Stream;
+
+import static google.registry.bsa.persistence.BsaTestingUtils.persistBsaLabel;
+import static google.registry.model.billing.BillingBase.RenewalPriceBehavior.DEFAULT;
+import static google.registry.model.billing.BillingBase.RenewalPriceBehavior.NONPREMIUM;
+import static google.registry.model.billing.BillingBase.RenewalPriceBehavior.SPECIFIED;
+import static google.registry.model.domain.token.AllocationToken.TokenType.DEFAULT_PROMO;
+import static google.registry.model.domain.token.AllocationToken.TokenType.REGISTER_BSA;
+import static google.registry.model.domain.token.AllocationToken.TokenType.SINGLE_USE;
+import static google.registry.model.domain.token.AllocationToken.TokenType.UNLIMITED_USE;
+import static google.registry.model.eppoutput.CheckData.DomainCheck.create;
+import static google.registry.model.tld.Tld.TldState.PREDELEGATION;
+import static google.registry.model.tld.Tld.TldState.START_DATE_SUNRISE;
+import static google.registry.testing.DatabaseHelper.createTld;
+import static google.registry.testing.DatabaseHelper.createTlds;
+import static google.registry.testing.DatabaseHelper.loadRegistrar;
+import static google.registry.testing.DatabaseHelper.persistActiveDomain;
+import static google.registry.testing.DatabaseHelper.persistBillingRecurrenceForDomain;
+import static google.registry.testing.DatabaseHelper.persistDeletedDomain;
+import static google.registry.testing.DatabaseHelper.persistPremiumList;
+import static google.registry.testing.DatabaseHelper.persistReservedList;
+import static google.registry.testing.DatabaseHelper.persistResource;
+import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
+import static google.registry.util.DateTimeUtils.START_OF_TIME;
+import static org.joda.money.CurrencyUnit.JPY;
+import static org.joda.money.CurrencyUnit.USD;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
/** Unit tests for {@link DomainCheckFlow}. */
class DomainCheckFlowTest extends ResourceCheckFlowTestCase {
@@ -951,23 +952,38 @@ void testFeeExtension_defaultToken_v11() throws Exception {
runFlowAssertResponse(loadFile("domain_check_fee_response_default_token_v11.xml"));
}
- @ParameterizedTest
- @MethodSource("provideFeeTestParams")
- void testFeeExtension_latest(String name, FeeFileLoader fileLoader) throws Exception {
+ @Test
+ void testFeeExtension_v12() throws Exception {
persistActiveDomain("example1.tld");
- setEppInputXml(fileLoader.load(this, "domain_check_fee_v12.xml"));
- runFlowAssertResponse(fileLoader.load(this, "domain_check_fee_response_v12.xml"));
+ setEppInput("domain_check_fee_v12.xml");
+ runFlowAssertResponse(loadFile("domain_check_fee_response_v12.xml"));
}
- @ParameterizedTest
- @MethodSource("provideFeeTestParams")
- void testFeeExtension_defaultToken_latest(String name, FeeFileLoader fileLoader)
+ @Test
+ void testFeeExtension_stdv1() throws Exception {
+ persistActiveDomain("example1.tld");
+ setEppInput("domain_check_fee_stdv1.xml");
+ runFlowAssertResponse(loadFile("domain_check_fee_response_stdv1.xml"));
+ }
+
+ @Test
+ void testFeeExtension_defaultToken_v12()
throws Exception {
setUpDefaultToken();
persistActiveDomain("example1.tld");
- setEppInputXml(
- fileLoader.load(this, "domain_check_fee_v12.xml", ImmutableMap.of("CURRENCY", "USD")));
- runFlowAssertResponse(fileLoader.load(this, "domain_check_fee_response_default_token_v12.xml"));
+ setEppInput(
+ "domain_check_fee_v12.xml", ImmutableMap.of("CURRENCY", "USD"));
+ runFlowAssertResponse(loadFile("domain_check_fee_response_default_token_v12.xml"));
+ }
+
+ @Test
+ void testFeeExtension_defaultToken_stdv1()
+ throws Exception {
+ setUpDefaultToken();
+ persistActiveDomain("example1.tld");
+ setEppInput(
+ "domain_check_fee_stdv1.xml", ImmutableMap.of("CURRENCY", "USD"));
+ runFlowAssertResponse(loadFile("domain_check_fee_response_default_token_stdv1.xml"));
}
@Test
@@ -1834,22 +1850,12 @@ void testSuccess_eapFeeCheck_date_v12() throws Exception {
new FeeFileLoader(/* isFeeStdV1= */ false));
}
- @Disabled("v1.0 buggy")
@Test
- void testSuccess_eapFeeCheck_std_v1() throws Exception {
+ void testSuccess_eapFeeCheck_stdv1() throws Exception {
runEapFeeCheckTest(
- "domain_check_fee_v12.xml",
- "domain_check_eap_fee_response_v12.xml",
- new FeeFileLoader(/* isFeeStdV1= */ true));
- }
-
- @Disabled("v1.0 buggy")
- @Test
- void testSuccess_eapFeeCheck_date_std_v1() throws Exception {
- runEapFeeCheckTest(
- "domain_check_fee_date_v12.xml",
- "domain_check_eap_fee_response_date_v12.xml",
- new FeeFileLoader(/* isFeeStdV1= */ true));
+ "domain_check_fee_stdv1.xml",
+ "domain_check_eap_fee_response_stdv1.xml",
+ new FeeFileLoader(/* isFeeStdV1= */ false));
}
@Test
@@ -2006,7 +2012,7 @@ String load(DomainCheckFlowTest test, String filename, Map subst
@SuppressWarnings("unused")
private static Stream provideFeeTestParams() {
return Stream.of(
- // Arguments.of("fee_std_v1", new FeeFileLoader(true)),
+ Arguments.of("fee_std_v1", new FeeFileLoader(true)),
Arguments.of("fee_12", new FeeFileLoader(false)));
}
}
diff --git a/core/src/test/resources/google/registry/flows/domain/domain_check_eap_fee_response_stdv1.xml b/core/src/test/resources/google/registry/flows/domain/domain_check_eap_fee_response_stdv1.xml
new file mode 100644
index 00000000000..99418a2308e
--- /dev/null
+++ b/core/src/test/resources/google/registry/flows/domain/domain_check_eap_fee_response_stdv1.xml
@@ -0,0 +1,55 @@
+
+
+
+ Command completed successfully
+
+
+
+
+ example1.tld
+ In use
+
+
+ example2.tld
+
+
+ example3.tld
+
+
+
+
+
+ USD
+
+ example1.tld
+
+ 1
+ 13.00
+ 100.00
+
+
+
+ example2.tld
+
+ 1
+ 13.00
+ 100.00
+
+
+
+ example3.tld
+
+ 1
+ 13.00
+ 100.00
+
+
+
+
+
+ ABC-12345
+ server-trid
+
+
+
diff --git a/core/src/test/resources/google/registry/flows/domain/domain_check_fee_response_default_token_stdv1.xml b/core/src/test/resources/google/registry/flows/domain/domain_check_fee_response_default_token_stdv1.xml
new file mode 100644
index 00000000000..882e35e5a50
--- /dev/null
+++ b/core/src/test/resources/google/registry/flows/domain/domain_check_fee_response_default_token_stdv1.xml
@@ -0,0 +1,52 @@
+
+
+
+ Command completed successfully
+
+
+
+
+ example1.tld
+ In use
+
+
+ example2.tld
+
+
+ example3.tld
+
+
+
+
+
+ USD
+
+ example1.tld
+
+ 1
+ 6.50
+
+
+
+ example2.tld
+
+ 1
+ 6.50
+
+
+
+ example3.tld
+
+ 1
+ 6.50
+
+
+
+
+
+ ABC-12345
+ server-trid
+
+
+
diff --git a/core/src/test/resources/google/registry/flows/domain/domain_check_fee_response_stdv1.xml b/core/src/test/resources/google/registry/flows/domain/domain_check_fee_response_stdv1.xml
new file mode 100644
index 00000000000..708612d0ea1
--- /dev/null
+++ b/core/src/test/resources/google/registry/flows/domain/domain_check_fee_response_stdv1.xml
@@ -0,0 +1,52 @@
+
+
+
+ Command completed successfully
+
+
+
+
+ example1.tld
+ In use
+
+
+ example2.tld
+
+
+ example3.tld
+
+
+
+
+
+ USD
+
+ example1.tld
+
+ 1
+ 13.00
+
+
+
+ example2.tld
+
+ 1
+ 13.00
+
+
+
+ example3.tld
+
+ 1
+ 13.00
+
+
+
+
+
+ ABC-12345
+ server-trid
+
+
+
diff --git a/core/src/test/resources/google/registry/flows/domain/domain_check_fee_stdv1.xml b/core/src/test/resources/google/registry/flows/domain/domain_check_fee_stdv1.xml
new file mode 100644
index 00000000000..0dee4c17ef5
--- /dev/null
+++ b/core/src/test/resources/google/registry/flows/domain/domain_check_fee_stdv1.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+ example1.tld
+ example2.tld
+ example3.tld
+
+
+
+
+ custom
+
+
+ USD
+
+ 1
+
+
+
+ ABC-12345
+
+
diff --git a/core/src/test/resources/google/registry/flows/greeting.xml b/core/src/test/resources/google/registry/flows/greeting.xml
index 3e4d3a54d68..f039bfca7bf 100644
--- a/core/src/test/resources/google/registry/flows/greeting.xml
+++ b/core/src/test/resources/google/registry/flows/greeting.xml
@@ -15,6 +15,7 @@
urn:ietf:params:xml:ns:fee-0.6
urn:ietf:params:xml:ns:fee-0.11
urn:ietf:params:xml:ns:fee-0.12
+ urn:ietf:params:xml:ns:epp:fee-1.0
diff --git a/core/src/test/resources/google/registry/flows/session/greeting.xml b/core/src/test/resources/google/registry/flows/session/greeting.xml
index 3e4d3a54d68..f039bfca7bf 100644
--- a/core/src/test/resources/google/registry/flows/session/greeting.xml
+++ b/core/src/test/resources/google/registry/flows/session/greeting.xml
@@ -15,6 +15,7 @@
urn:ietf:params:xml:ns:fee-0.6
urn:ietf:params:xml:ns:fee-0.11
urn:ietf:params:xml:ns:fee-0.12
+ urn:ietf:params:xml:ns:epp:fee-1.0