Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,7 +27,6 @@
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;
Expand Down Expand Up @@ -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<String> getSchemas() {
if (RegistryEnvironment.get().equals(RegistryEnvironment.PRODUCTION)) {
return ALL_SCHEMAS.stream()
.filter(s -> !NON_PROD_SCHEMAS.contains(s))
.collect(toImmutableList());
}
return ALL_SCHEMAS;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ void testSchemas_inNonProduction_includesFee1Point0() {
}

@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();
}
Expand Down
Loading