Add domain lifecycle test for renew with total term >10 years

Also some minor cleanup to make renewal testdata files easier to reuse.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187508329
This commit is contained in:
mcilwain 2018-03-01 11:36:03 -08:00 committed by jianglai
parent 27894df45f
commit ef26dabf32
6 changed files with 79 additions and 24 deletions

View file

@ -817,6 +817,21 @@ public class EppLifecycleDomainTest extends EppTestCase {
assertCommandAndResponse("logout.xml", "logout_response.xml");
}
@Test
public void testRenewalFails_whenTotalTermExceeds10Years() throws Exception {
assertCommandAndResponse("login_valid.xml", "login_response.xml");
// Creates domain with 2 year expiration.
createFakesite();
// Attempt to renew for 9 years, adding up to a total greater than the allowed max of 10 years.
assertCommandAndResponse(
"domain_renew.xml",
ImmutableMap.of("DOMAIN", "fakesite.example", "EXPDATE", "2002-06-01", "YEARS", "9"),
"domain_renew_response_exceeds_max_years.xml",
ImmutableMap.of(),
DateTime.parse("2000-06-07T00:00:00Z"));
assertCommandAndResponse("logout.xml", "logout_response.xml");
}
@Test
public void testDomainDeletionCancelsPendingTransfer() throws Exception {
// Register the domain as the first registrar.