From e289df8a03a0ee80fba1ba6502e886ec357cf8a3 Mon Sep 17 00:00:00 2001 From: mcilwain Date: Tue, 17 Jul 2018 15:01:50 -0700 Subject: [PATCH] Consolidate more wildcarded lifecycle domain testdata XMLs Specifically domain_info.xml, domain_delete.xml, and domain_create_response.xml. As of this CL, all domain-related commands are standardized on the parameter "DOMAIN" for the domain name. No more ambiguous "NAME", which could be confused with a host name. This finishes the domain_create_response consolidation work from [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=204981136 --- .../registry/flows/EppCommitLogsTest.java | 4 +- .../flows/EppLifecycleDomainTest.java | 63 ++++++++++--------- .../registry/flows/EppLifecycleHostTest.java | 8 +-- .../flows/testdata/domain_create_response.xml | 2 +- .../registry/flows/testdata/domain_delete.xml | 2 +- .../registry/flows/testdata/domain_info.xml | 2 +- .../domain_info_response_ok_wildcard.xml | 2 +- .../flows/testdata/domain_info_wildcard.xml | 11 ---- 8 files changed, 42 insertions(+), 52 deletions(-) delete mode 100644 javatests/google/registry/flows/testdata/domain_info_wildcard.xml diff --git a/javatests/google/registry/flows/EppCommitLogsTest.java b/javatests/google/registry/flows/EppCommitLogsTest.java index 56553377a..aa07fa2ff 100644 --- a/javatests/google/registry/flows/EppCommitLogsTest.java +++ b/javatests/google/registry/flows/EppCommitLogsTest.java @@ -125,8 +125,8 @@ public class EppCommitLogsTest extends ShardableTestCase { DomainResource domainAfterSecondUpdate = ofy().load().key(key).now(); clock.advanceBy(standardDays(2)); - DateTime timeAtDelete = clock.nowUtc(); // before 'add' grace period ends - eppLoader = new EppLoader(this, "domain_delete.xml", ImmutableMap.of("NAME", "example.tld")); + DateTime timeAtDelete = clock.nowUtc(); // before 'add' grace period ends + eppLoader = new EppLoader(this, "domain_delete.xml", ImmutableMap.of("DOMAIN", "example.tld")); runFlow(); ofy().clearSessionCache(); diff --git a/javatests/google/registry/flows/EppLifecycleDomainTest.java b/javatests/google/registry/flows/EppLifecycleDomainTest.java index 12585f0ec..b4274518b 100644 --- a/javatests/google/registry/flows/EppLifecycleDomainTest.java +++ b/javatests/google/registry/flows/EppLifecycleDomainTest.java @@ -108,7 +108,7 @@ public class EppLifecycleDomainTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "fakesite.example", + "DOMAIN", "fakesite.example", "CRDATE", "2000-06-01T00:04:00.0Z", "EXDATE", "2002-06-01T00:04:00.0Z")); assertThatCommand("domain_info_fakesite.xml") @@ -148,12 +148,12 @@ public class EppLifecycleDomainTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "example.tld", + "DOMAIN", "example.tld", "CRDATE", "2000-06-01T00:02:00.0Z", "EXDATE", "2002-06-01T00:02:00.0Z")); // Delete domain example.tld after its add grace period has expired. - assertThatCommand("domain_delete.xml", ImmutableMap.of("NAME", "example.tld")) + assertThatCommand("domain_delete.xml", ImmutableMap.of("DOMAIN", "example.tld")) .atTime("2000-07-01T00:02:00Z") .hasResponse("generic_success_action_pending_response.xml"); @@ -178,7 +178,7 @@ public class EppLifecycleDomainTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "example.tld", + "DOMAIN", "example.tld", "CRDATE", "2000-06-01T00:02:00.0Z", "EXDATE", "2002-06-01T00:02:00.0Z")); @@ -187,12 +187,12 @@ public class EppLifecycleDomainTest extends EppTestCase { // Delete domain example.tld within the add grace period. DateTime deleteTime = createTime.plusDays(1); - assertThatCommand("domain_delete.xml", ImmutableMap.of("NAME", "example.tld")) + assertThatCommand("domain_delete.xml", ImmutableMap.of("DOMAIN", "example.tld")) .atTime(deleteTime) .hasResponse("generic_success_response.xml"); // Verify that it is immediately non-existent. - assertThatCommand("domain_info.xml") + assertThatCommand("domain_info.xml", ImmutableMap.of("DOMAIN", "example.tld")) .atTime(deleteTime.plusSeconds(1)) .hasResponse( "response_error.xml", @@ -227,30 +227,30 @@ public class EppLifecycleDomainTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "example.tld", + "DOMAIN", "example.tld", "CRDATE", "2000-06-01T00:02:00.0Z", "EXDATE", "2002-06-01T00:02:00.0Z")); DateTime deleteTime = DateTime.parse("2000-07-07T00:02:00Z"); // 1 month and 6 days after // Delete domain example.tld after its add grace period has expired. - assertThatCommand("domain_delete.xml", ImmutableMap.of("NAME", "example.tld")) + assertThatCommand("domain_delete.xml", ImmutableMap.of("DOMAIN", "example.tld")) .atTime(deleteTime) .hasResponse("generic_success_action_pending_response.xml"); // Verify that domain shows redemptionPeriod soon after deletion. - assertThatCommand("domain_info.xml") + assertThatCommand("domain_info.xml", ImmutableMap.of("DOMAIN", "example.tld")) .atTime("2000-07-08T00:00:00Z") .hasResponse( "domain_info_response_wildcard.xml", ImmutableMap.of("STATUS", "redemptionPeriod")); // Verify that the domain shows pendingDelete next. - assertThatCommand("domain_info.xml") + assertThatCommand("domain_info.xml", ImmutableMap.of("DOMAIN", "example.tld")) .atTime("2000-08-08T00:00:00Z") .hasResponse( "domain_info_response_wildcard.xml", ImmutableMap.of("STATUS", "pendingDelete")); // Verify that the domain is non-existent (available for registration) later. - assertThatCommand("domain_info.xml") + assertThatCommand("domain_info.xml", ImmutableMap.of("DOMAIN", "example.tld")) .atTime("2000-09-01T00:00:00Z") .hasResponse( "response_error.xml", @@ -297,7 +297,7 @@ public class EppLifecycleDomainTest extends EppTestCase { // Delete domain example.tld within the add grade period. DateTime deleteTime = createTime.plusDays(1); - assertThatCommand("domain_delete.xml", ImmutableMap.of("NAME", "example.tld")) + assertThatCommand("domain_delete.xml", ImmutableMap.of("DOMAIN", "example.tld")) .atTime(deleteTime) .hasResponse("domain_delete_response_fee.xml"); @@ -409,7 +409,7 @@ public class EppLifecycleDomainTest extends EppTestCase { assertThatLoginSucceeds("NewRegistrar", "foo-BAR2"); createFakesite(); createSubordinateHost(); - assertThatCommand("domain_delete.xml", ImmutableMap.of("NAME", "fakesite.example")) + assertThatCommand("domain_delete.xml", ImmutableMap.of("DOMAIN", "fakesite.example")) .atTime("2002-05-30T01:01:00Z") .hasResponse( "response_error.xml", @@ -444,7 +444,7 @@ public class EppLifecycleDomainTest extends EppTestCase { .and() .hasStatus(SUCCESS); // Delete the fakesite.example domain (which should succeed since it no longer has subords). - assertThatCommand("domain_delete.xml", ImmutableMap.of("NAME", "fakesite.example")) + assertThatCommand("domain_delete.xml", ImmutableMap.of("DOMAIN", "fakesite.example")) .atTime("2002-05-30T01:02:00Z") .hasResponse("generic_success_action_pending_response.xml"); assertThat(getRecordedEppMetric()) @@ -490,7 +490,7 @@ public class EppLifecycleDomainTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "example.tld", + "DOMAIN", "example.tld", "CRDATE", "2000-06-02T00:00:00.0Z", "EXDATE", "2002-06-02T00:00:00.0Z")); @@ -505,7 +505,7 @@ public class EppLifecycleDomainTest extends EppTestCase { .hasResponse("generic_success_response.xml"); // Attempt to delete the fakesite.example domain (which should fail since it now has a // subordinate host). - assertThatCommand("domain_delete.xml", ImmutableMap.of("NAME", "fakesite.example")) + assertThatCommand("domain_delete.xml", ImmutableMap.of("DOMAIN", "fakesite.example")) .atTime("2002-05-30T01:02:00Z") .hasResponse( "response_error.xml", @@ -792,7 +792,7 @@ public class EppLifecycleDomainTest extends EppTestCase { assertThatCommand("domain_info_fakesite.xml") .atTime("2002-05-30T01:00:00Z") .hasResponse("domain_info_response_fakesite_pending_transfer.xml"); - assertThatCommand("domain_delete.xml", ImmutableMap.of("NAME", "fakesite.example")) + assertThatCommand("domain_delete.xml", ImmutableMap.of("DOMAIN", "fakesite.example")) .atTime("2002-05-30T01:01:00Z") .hasResponse("generic_success_action_pending_response.xml"); assertThatCommand("domain_info_fakesite.xml") @@ -875,7 +875,7 @@ public class EppLifecycleDomainTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "secondsite.example", + "DOMAIN", "secondsite.example", "CRDATE", "2001-01-08T00:00:00.0Z", "EXDATE", "2003-01-08T00:00:00.0Z")); // Update the host to be subordinate to a different domain by renaming it to @@ -958,7 +958,7 @@ public class EppLifecycleDomainTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "example.bar.foo.tld", + "DOMAIN", "example.bar.foo.tld", "CRDATE", "2000-06-01T00:02:00Z", "EXDATE", "2002-06-01T00:02:00Z")); @@ -969,7 +969,7 @@ public class EppLifecycleDomainTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "example.foo.tld", + "DOMAIN", "example.foo.tld", "CRDATE", "2000-06-01T00:02:00Z", "EXDATE", "2002-06-01T00:02:00Z")); @@ -980,7 +980,7 @@ public class EppLifecycleDomainTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "example.tld", + "DOMAIN", "example.tld", "CRDATE", "2000-06-01T00:02:00Z", "EXDATE", "2002-06-01T00:02:00Z")); @@ -1001,7 +1001,7 @@ public class EppLifecycleDomainTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "example.tld.foo", + "DOMAIN", "example.tld.foo", "CRDATE", "2000-06-01T00:02:00Z", "EXDATE", "2002-06-01T00:02:00Z")); @@ -1012,7 +1012,7 @@ public class EppLifecycleDomainTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "example.tld", + "DOMAIN", "example.tld", "CRDATE", "2000-06-01T00:02:00Z", "EXDATE", "2002-06-01T00:02:00Z")); @@ -1071,11 +1071,11 @@ public class EppLifecycleDomainTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "test-validate.example", + "DOMAIN", "test-validate.example", "CRDATE", "2014-09-09T09:09:09Z", "EXDATE", "2015-09-09T09:09:09Z")); - assertThatCommand("domain_delete.xml", ImmutableMap.of("NAME", "test-validate.example")) + assertThatCommand("domain_delete.xml", ImmutableMap.of("DOMAIN", "test-validate.example")) .atTime(sunriseDate.plusDays(1).plusMinutes(1)) .hasResponse("generic_success_response.xml"); @@ -1106,7 +1106,7 @@ public class EppLifecycleDomainTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "general.example", + "DOMAIN", "general.example", "CRDATE", "2014-10-10T09:09:09Z", "EXDATE", "2016-10-10T09:09:09Z")); @@ -1139,28 +1139,29 @@ public class EppLifecycleDomainTest extends EppTestCase { // During start-date sunrise, create with mark will succeed but without will fail. // We also test we can delete without a mark. - assertThatCommand("domain_info.xml", ImmutableMap.of("NAME", "test-validate.example")) + assertThatCommand("domain_info.xml", ImmutableMap.of("DOMAIN", "test-validate.example")) .atTime(sunriseDate.plusDays(1)) .hasResponse( "response_error.xml", ImmutableMap.of( - "CODE", "2303", "MSG", "The domain with given ID (example.tld) doesn't exist.")); + "CODE", "2303", + "MSG", "The domain with given ID (test-validate.example) doesn't exist.")); assertThatCommand("domain_create_start_date_sunrise_encoded_mark_no_type.xml") .atTime(sunriseDate.plusDays(1).plusMinutes(1)) .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "test-validate.example", + "DOMAIN", "test-validate.example", "CRDATE", "2014-09-09T09:10:09Z", "EXDATE", "2015-09-09T09:10:09Z")); - assertThatCommand("domain_info_wildcard.xml", ImmutableMap.of("NAME", "test-validate.example")) + assertThatCommand("domain_info.xml", ImmutableMap.of("DOMAIN", "test-validate.example")) .atTime(sunriseDate.plusDays(1).plusMinutes(2)) .hasResponse( "domain_info_response_ok_wildcard.xml", ImmutableMap.of( - "NAME", "test-validate.example", + "DOMAIN", "test-validate.example", "CRDATE", "2014-09-09T09:10:09Z", "EXDATE", "2015-09-09T09:10:09Z")); diff --git a/javatests/google/registry/flows/EppLifecycleHostTest.java b/javatests/google/registry/flows/EppLifecycleHostTest.java index 37e8d71ca..fb918c292 100644 --- a/javatests/google/registry/flows/EppLifecycleHostTest.java +++ b/javatests/google/registry/flows/EppLifecycleHostTest.java @@ -116,7 +116,7 @@ public class EppLifecycleHostTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "fakesite.example", + "DOMAIN", "fakesite.example", "CRDATE", "2000-06-01T00:04:00.0Z", "EXDATE", "2002-06-01T00:04:00.0Z")); assertThatCommand("domain_info_fakesite.xml") @@ -171,7 +171,7 @@ public class EppLifecycleHostTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "example.bar.foo.tld", + "DOMAIN", "example.bar.foo.tld", "CRDATE", "2000-06-01T00:02:00Z", "EXDATE", "2002-06-01T00:02:00Z")); @@ -182,7 +182,7 @@ public class EppLifecycleHostTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "example.foo.tld", + "DOMAIN", "example.foo.tld", "CRDATE", "2000-06-01T00:02:00Z", "EXDATE", "2002-06-01T00:02:00Z")); @@ -193,7 +193,7 @@ public class EppLifecycleHostTest extends EppTestCase { .hasResponse( "domain_create_response.xml", ImmutableMap.of( - "NAME", "example.tld", + "DOMAIN", "example.tld", "CRDATE", "2000-06-01T00:02:00Z", "EXDATE", "2002-06-01T00:02:00Z")); diff --git a/javatests/google/registry/flows/testdata/domain_create_response.xml b/javatests/google/registry/flows/testdata/domain_create_response.xml index 2cdff5be6..4593cba54 100644 --- a/javatests/google/registry/flows/testdata/domain_create_response.xml +++ b/javatests/google/registry/flows/testdata/domain_create_response.xml @@ -6,7 +6,7 @@ - %NAME% + %DOMAIN% %CRDATE% %EXDATE% diff --git a/javatests/google/registry/flows/testdata/domain_delete.xml b/javatests/google/registry/flows/testdata/domain_delete.xml index 8aff149ea..906a2633e 100644 --- a/javatests/google/registry/flows/testdata/domain_delete.xml +++ b/javatests/google/registry/flows/testdata/domain_delete.xml @@ -2,7 +2,7 @@ - %NAME% + %DOMAIN% ABC-12345 diff --git a/javatests/google/registry/flows/testdata/domain_info.xml b/javatests/google/registry/flows/testdata/domain_info.xml index 15a31a9d1..d3336dece 100644 --- a/javatests/google/registry/flows/testdata/domain_info.xml +++ b/javatests/google/registry/flows/testdata/domain_info.xml @@ -3,7 +3,7 @@ - example.tld + %DOMAIN% ABC-12345 diff --git a/javatests/google/registry/flows/testdata/domain_info_response_ok_wildcard.xml b/javatests/google/registry/flows/testdata/domain_info_response_ok_wildcard.xml index 2d075b18b..ca54ad245 100644 --- a/javatests/google/registry/flows/testdata/domain_info_response_ok_wildcard.xml +++ b/javatests/google/registry/flows/testdata/domain_info_response_ok_wildcard.xml @@ -6,7 +6,7 @@ - %NAME% + %DOMAIN% %ROID% jd1234 diff --git a/javatests/google/registry/flows/testdata/domain_info_wildcard.xml b/javatests/google/registry/flows/testdata/domain_info_wildcard.xml deleted file mode 100644 index 3f1cb951a..000000000 --- a/javatests/google/registry/flows/testdata/domain_info_wildcard.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - %NAME% - - - ABC-12345 - -