mirror of
https://github.com/google/nomulus
synced 2026-08-19 21:56:17 +00:00
Only include fee 1.0 extension in nonprod envs (#2927)
We need to have this enabled in sandbox, but we wish to wait to enable it for production to make sure that the implementation is correct and that clients can use it. Soon we'll want to do something similar (but the opposite) with the old fee extensions, where we **only** serve them in production (or maybe unit test as well). That will allow us to pass the RST tests that depend on only having the fee extension 1.0.
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
|
||||
package google.registry.flows;
|
||||
|
||||
import static org.joda.time.DateTimeZone.UTC;
|
||||
import static org.joda.time.format.ISODateTimeFormat.dateTimeNoMillis;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
@@ -26,7 +25,7 @@ class EppLoggedOutTest extends EppTestCase {
|
||||
|
||||
@Test
|
||||
void testHello() throws Exception {
|
||||
DateTime now = DateTime.now(UTC);
|
||||
DateTime now = clock.nowUtc();
|
||||
assertThatCommand("hello.xml", null)
|
||||
.atTime(now)
|
||||
.hasResponse("greeting.xml", ImmutableMap.of("DATE", now.toString(dateTimeNoMillis())));
|
||||
|
||||
@@ -21,6 +21,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import google.registry.model.eppinput.EppInput;
|
||||
import google.registry.model.eppoutput.EppOutput;
|
||||
import google.registry.util.RegistryEnvironment;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/** Tests for {@link EppXmlTransformer}. */
|
||||
@@ -38,4 +39,26 @@ class EppXmlTransformerTest {
|
||||
ClassCastException.class,
|
||||
() -> unmarshal(EppOutput.class, loadBytes(getClass(), "contact_info.xml").read()));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSchemas_inNonProduction_includesFee1Point0() {
|
||||
var currentEnv = RegistryEnvironment.get();
|
||||
try {
|
||||
RegistryEnvironment.SANDBOX.setup();
|
||||
assertThat(EppXmlTransformer.getSchemas()).contains("fee-std-v1.xsd");
|
||||
} finally {
|
||||
currentEnv.setup();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSchemas_inProduction_skipsFee1Point0() {
|
||||
var currentEnv = RegistryEnvironment.get();
|
||||
try {
|
||||
RegistryEnvironment.PRODUCTION.setup();
|
||||
assertThat(EppXmlTransformer.getSchemas()).doesNotContain("fee-std-v1.xsd");
|
||||
} finally {
|
||||
currentEnv.setup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<extURI>urn:ietf:params:xml:ns:fee-0.6</extURI>
|
||||
<extURI>urn:ietf:params:xml:ns:fee-0.11</extURI>
|
||||
<extURI>urn:ietf:params:xml:ns:fee-0.12</extURI>
|
||||
<extURI>urn:ietf:params:xml:ns:epp:fee-1.0</extURI>
|
||||
</svcExtension>
|
||||
</svcMenu>
|
||||
<dcp>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<extURI>urn:ietf:params:xml:ns:fee-0.6</extURI>
|
||||
<extURI>urn:ietf:params:xml:ns:fee-0.11</extURI>
|
||||
<extURI>urn:ietf:params:xml:ns:fee-0.12</extURI>
|
||||
<extURI>urn:ietf:params:xml:ns:epp:fee-1.0</extURI>
|
||||
</svcExtension>
|
||||
</svcMenu>
|
||||
<dcp>
|
||||
|
||||
Reference in New Issue
Block a user