mirror of
https://github.com/google/nomulus.git
synced 2025-08-03 16:32:11 +02:00
Remove obsolete TransferData.extendedRegistrationYears
Now that transfers are always restricted to 1 year, it's unnecessary to store extendedRegistrationYears on TransferData - it will always be equal to 1. This simplifies logic in a few other places, e.g. RdeDomainImportAction. I verified in BigQuery that no DomainBases exist with extendedRegistrationYears values that aren't either null or equal to 1. At some point we should remove the persisted fields from datastore via e.g. resaving all those domains, but it's low priority and can wait until we have some more pressing migration. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=150373897
This commit is contained in:
parent
70fbdccea2
commit
09f619cce2
29 changed files with 54 additions and 215 deletions
|
@ -298,18 +298,15 @@ public class DomainTransferApproveFlowTest
|
|||
DateTime oldExpirationTime = clock.nowUtc().minusDays(1);
|
||||
persistResource(domain.asBuilder()
|
||||
.setRegistrationExpirationTime(oldExpirationTime)
|
||||
.setTransferData(domain.getTransferData().asBuilder()
|
||||
.setExtendedRegistrationYears(2)
|
||||
.build())
|
||||
.build());
|
||||
// The autorenew should be subsumed into the transfer resulting in 2 years of renewal in total.
|
||||
// The autorenew should be subsumed into the transfer resulting in 1 year of renewal in total.
|
||||
clock.advanceOneMilli();
|
||||
doSuccessfulTest(
|
||||
"tld",
|
||||
"domain_transfer_approve_domain_authinfo.xml",
|
||||
"domain_transfer_approve_response_autorenew.xml",
|
||||
oldExpirationTime.plusYears(2),
|
||||
2,
|
||||
oldExpirationTime.plusYears(1),
|
||||
1,
|
||||
// Expect the grace period for autorenew to be cancelled.
|
||||
new BillingEvent.Cancellation.Builder()
|
||||
.setReason(Reason.RENEW)
|
||||
|
|
|
@ -101,7 +101,6 @@ public class DomainTransferFlowTestCase<F extends Flow, R extends EppResource>
|
|||
TRANSFER_REQUEST_TIME,
|
||||
TRANSFER_EXPIRATION_TIME,
|
||||
EXTENDED_REGISTRATION_EXPIRATION_TIME,
|
||||
EXTENDED_REGISTRATION_YEARS,
|
||||
TRANSFER_REQUEST_TIME);
|
||||
}
|
||||
|
||||
|
@ -176,8 +175,7 @@ public class DomainTransferFlowTestCase<F extends Flow, R extends EppResource>
|
|||
domain,
|
||||
historyEntry,
|
||||
TRANSFER_REQUEST_TIME,
|
||||
TRANSFER_EXPIRATION_TIME,
|
||||
EXTENDED_REGISTRATION_YEARS);
|
||||
TRANSFER_EXPIRATION_TIME);
|
||||
}
|
||||
|
||||
/** Get the autorenew event that the losing client will have after a SERVER_APPROVED transfer. */
|
||||
|
|
|
@ -148,10 +148,10 @@ public class DomainTransferQueryFlowTest
|
|||
|
||||
@Test
|
||||
public void testSuccess_tenYears() throws Exception {
|
||||
// Extend registration by 9 years here; with the extra 1 year from the transfer, we should
|
||||
// hit the 10-year capping.
|
||||
domain = persistResource(domain.asBuilder()
|
||||
.setTransferData(domain.getTransferData().asBuilder()
|
||||
.setExtendedRegistrationYears(10)
|
||||
.build())
|
||||
.setRegistrationExpirationTime(domain.getRegistrationExpirationTime().plusYears(9))
|
||||
.build());
|
||||
doSuccessfulTest(
|
||||
"domain_transfer_query.xml",
|
||||
|
|
|
@ -164,7 +164,6 @@ public class DomainTransferRequestFlowTest
|
|||
domain = reloadResourceByForeignKey();
|
||||
final HistoryEntry historyEntryTransferRequest =
|
||||
getOnlyHistoryEntryOfType(domain, HistoryEntry.Type.DOMAIN_TRANSFER_REQUEST);
|
||||
int registrationYears = domain.getTransferData().getExtendedRegistrationYears();
|
||||
subordinateHost = reloadResourceAndCloneAtTime(subordinateHost, clock.nowUtc());
|
||||
assertTransferRequested(domain);
|
||||
assertAboutDomains().that(domain)
|
||||
|
@ -174,7 +173,7 @@ public class DomainTransferRequestFlowTest
|
|||
HistoryEntry.Type.DOMAIN_TRANSFER_REQUEST);
|
||||
assertAboutHistoryEntries()
|
||||
.that(historyEntryTransferRequest)
|
||||
.hasPeriodYears(registrationYears)
|
||||
.hasPeriodYears(1)
|
||||
.and()
|
||||
.hasOtherClientId("TheRegistrar");
|
||||
assertAboutHosts().that(subordinateHost).hasNoHistoryEntries();
|
||||
|
@ -190,8 +189,8 @@ public class DomainTransferRequestFlowTest
|
|||
.setEventTime(implicitTransferTime)
|
||||
.setBillingTime(implicitTransferTime.plus(registry.getTransferGracePeriodLength()))
|
||||
.setClientId("NewRegistrar")
|
||||
.setCost(transferCost.or(Money.of(USD, 11).multipliedBy(registrationYears)))
|
||||
.setPeriodYears(registrationYears)
|
||||
.setCost(transferCost.or(Money.of(USD, 11)))
|
||||
.setPeriodYears(1)
|
||||
.setParent(historyEntryTransferRequest)
|
||||
.build();
|
||||
assertBillingEvents(FluentIterable.from(extraExpectedBillingEvents)
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<domain:reDate>2000-06-06T22:00:00.0Z</domain:reDate>
|
||||
<domain:acID>TheRegistrar</domain:acID>
|
||||
<domain:acDate>2000-06-09T22:00:00.0Z</domain:acDate>
|
||||
<domain:exDate>2002-06-08T22:00:00.0Z</domain:exDate>
|
||||
<domain:exDate>2001-06-08T22:00:00.0Z</domain:exDate>
|
||||
</domain:trnData>
|
||||
</resData>
|
||||
<trID>
|
||||
|
|
|
@ -193,7 +193,6 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
.setTransferRequestTime(requestTime)
|
||||
.setLosingClientId("TheRegistrar")
|
||||
.setPendingTransferExpirationTime(transferExpirationTime)
|
||||
.setExtendedRegistrationYears(1)
|
||||
.build())
|
||||
.build());
|
||||
persistResource(
|
||||
|
@ -222,7 +221,6 @@ public class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, Hos
|
|||
.setTransferRequestTime(requestTime)
|
||||
.setLosingClientId("NewRegistrar")
|
||||
.setPendingTransferExpirationTime(transferExpirationTime)
|
||||
.setExtendedRegistrationYears(1)
|
||||
.build())
|
||||
.build());
|
||||
persistResource(
|
||||
|
|
|
@ -113,7 +113,6 @@ public class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, Hos
|
|||
.setTransferRequestTime(requestTime)
|
||||
.setLosingClientId("TheRegistrar")
|
||||
.setPendingTransferExpirationTime(transferExpirationTime)
|
||||
.setExtendedRegistrationYears(1)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue