Make Hello flows use the flow "now" time

This cleans up some of the tests, and helps with
future injection CLs.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124208164
This commit is contained in:
Corey Goldfeder 2016-06-06 20:41:37 -07:00 committed by Justine Tunney
parent 81dc55ceab
commit 5a2f63cf58
7 changed files with 30 additions and 19 deletions

View file

@ -14,10 +14,10 @@
package google.registry.flows.session;
import static google.registry.flows.EppXmlTransformer.marshal;
import static google.registry.xml.ValidationMode.STRICT;
import static google.registry.xml.XmlTestUtils.assertXmlEquals;
import static java.nio.charset.StandardCharsets.UTF_8;
import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions;
import static org.joda.time.format.ISODateTimeFormat.dateTimeNoMillis;
import com.google.common.collect.ImmutableMap;
import google.registry.flows.FlowTestCase;
@ -29,8 +29,11 @@ public class HelloFlowTest extends FlowTestCase<HelloFlow> {
public void testHello() throws Exception {
setEppInput("hello.xml");
assertTransactionalFlow(false);
assertXmlEquals(readFile("greeting_crr.xml"), new String(marshal(runFlow(), STRICT), UTF_8),
"epp.greeting.svDate");
runFlowAssertResponse(
loadFileWithSubstitutions(
getClass(),
"greeting_crr.xml",
ImmutableMap.of("DATE", clock.nowUtc().toString(dateTimeNoMillis()))));
}
// Extra methods so the test runner doesn't produce empty shards.