Skip to content

Commit 4a1d060

Browse files
authored
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.
1 parent 61b121f commit 4a1d060

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

core/src/main/java/google/registry/model/eppcommon/EppXmlTransformer.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
package google.registry.model.eppcommon;
1616

17-
import static com.google.common.collect.ImmutableList.toImmutableList;
1817
import static java.nio.charset.StandardCharsets.UTF_8;
1918

2019
import com.google.common.annotations.VisibleForTesting;
@@ -28,7 +27,6 @@
2827
import google.registry.model.eppinput.EppInput;
2928
import google.registry.model.eppoutput.EppOutput;
3029
import google.registry.model.eppoutput.EppResponse;
31-
import google.registry.util.RegistryEnvironment;
3230
import google.registry.xml.ValidationMode;
3331
import google.registry.xml.XmlException;
3432
import google.registry.xml.XmlTransformer;
@@ -71,13 +69,9 @@ public class EppXmlTransformer {
7169
private static final XmlTransformer OUTPUT_TRANSFORMER =
7270
new XmlTransformer(getSchemas(), EppOutput.class);
7371

72+
// TODO(b/159033801): remove method and inline ALL_SCHEMA.
7473
@VisibleForTesting
7574
public static ImmutableList<String> getSchemas() {
76-
if (RegistryEnvironment.get().equals(RegistryEnvironment.PRODUCTION)) {
77-
return ALL_SCHEMAS.stream()
78-
.filter(s -> !NON_PROD_SCHEMAS.contains(s))
79-
.collect(toImmutableList());
80-
}
8175
return ALL_SCHEMAS;
8276
}
8377

core/src/test/java/google/registry/model/eppcommon/EppXmlTransformerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ void testSchemas_inNonProduction_includesFee1Point0() {
8282
}
8383

8484
@Test
85-
void testSchemas_inProduction_skipsFee1Point0() {
85+
void testSchemas_inProduction_includesFee1Point0() {
8686
var currentEnv = RegistryEnvironment.get();
8787
try {
8888
RegistryEnvironment.PRODUCTION.setup();
89-
assertThat(EppXmlTransformer.getSchemas()).doesNotContain("fee-std-v1.xsd");
89+
assertThat(EppXmlTransformer.getSchemas()).contains("fee-std-v1.xsd");
9090
} finally {
9191
currentEnv.setup();
9292
}

0 commit comments

Comments
 (0)