From 4a1d0609f3b1fb72458073983fe4ef0894f14eba Mon Sep 17 00:00:00 2001 From: Weimin Yu Date: Thu, 9 Apr 2026 20:45:36 +0000 Subject: [PATCH] Support Fee-1.0 XML parser in all environments (#3007) Add the Fee-1.0 schema in production, allowing the requests with this extension to be parsed. This allows us to test this extension before hand. The announcement of this extension in greeting is controlled by a feature flag in ProtocolDefinition.java. As long as it is not announced, we do not expect real customers to use this extension. --- .../registry/model/eppcommon/EppXmlTransformer.java | 8 +------- .../registry/model/eppcommon/EppXmlTransformerTest.java | 4 ++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/google/registry/model/eppcommon/EppXmlTransformer.java b/core/src/main/java/google/registry/model/eppcommon/EppXmlTransformer.java index a8fa72898..5f0bd494a 100644 --- a/core/src/main/java/google/registry/model/eppcommon/EppXmlTransformer.java +++ b/core/src/main/java/google/registry/model/eppcommon/EppXmlTransformer.java @@ -14,7 +14,6 @@ package google.registry.model.eppcommon; -import static com.google.common.collect.ImmutableList.toImmutableList; import static java.nio.charset.StandardCharsets.UTF_8; import com.google.common.annotations.VisibleForTesting; @@ -28,7 +27,6 @@ import google.registry.model.domain.fee06.FeeInfoResponseExtensionV06; import google.registry.model.eppinput.EppInput; import google.registry.model.eppoutput.EppOutput; import google.registry.model.eppoutput.EppResponse; -import google.registry.util.RegistryEnvironment; import google.registry.xml.ValidationMode; import google.registry.xml.XmlException; import google.registry.xml.XmlTransformer; @@ -71,13 +69,9 @@ public class EppXmlTransformer { private static final XmlTransformer OUTPUT_TRANSFORMER = new XmlTransformer(getSchemas(), EppOutput.class); + // TODO(b/159033801): remove method and inline ALL_SCHEMA. @VisibleForTesting public static ImmutableList getSchemas() { - if (RegistryEnvironment.get().equals(RegistryEnvironment.PRODUCTION)) { - return ALL_SCHEMAS.stream() - .filter(s -> !NON_PROD_SCHEMAS.contains(s)) - .collect(toImmutableList()); - } return ALL_SCHEMAS; } diff --git a/core/src/test/java/google/registry/model/eppcommon/EppXmlTransformerTest.java b/core/src/test/java/google/registry/model/eppcommon/EppXmlTransformerTest.java index 2054769e6..7ca6bceec 100644 --- a/core/src/test/java/google/registry/model/eppcommon/EppXmlTransformerTest.java +++ b/core/src/test/java/google/registry/model/eppcommon/EppXmlTransformerTest.java @@ -82,11 +82,11 @@ class EppXmlTransformerTest { } @Test - void testSchemas_inProduction_skipsFee1Point0() { + void testSchemas_inProduction_includesFee1Point0() { var currentEnv = RegistryEnvironment.get(); try { RegistryEnvironment.PRODUCTION.setup(); - assertThat(EppXmlTransformer.getSchemas()).doesNotContain("fee-std-v1.xsd"); + assertThat(EppXmlTransformer.getSchemas()).contains("fee-std-v1.xsd"); } finally { currentEnv.setup(); }