Fix URS check in BackfillRegistryLocksCommand (#1315)

* Fix URS check in BackfillRegistryLocksCommand

"reason" can be null
This commit is contained in:
gbrodman
2021-09-13 14:15:25 -04:00
committed by GitHub
parent 0e6b5e949d
commit 1ced2b0a5d
2 changed files with 13 additions and 6 deletions
@@ -127,7 +127,7 @@ class BackfillRegistryLocksCommandTest extends CommandTestCase<BackfillRegistryL
void testBackfill_usesUrsTime_ifExists() throws Exception {
DateTime ursTime = fakeClock.nowUtc();
DomainBase ursDomain = persistLockedDomain("urs.tld");
HistoryEntry historyEntry =
persistResource(
new DomainHistory.Builder()
.setBySuperuser(true)
.setClientId("adminreg")
@@ -136,9 +136,17 @@ class BackfillRegistryLocksCommandTest extends CommandTestCase<BackfillRegistryL
.setReason("Uniform Rapid Suspension")
.setType(HistoryEntry.Type.DOMAIN_UPDATE)
.setRequestedByRegistrar(false)
.build();
persistResource(historyEntry);
.build());
DomainBase nonUrsDomain = persistLockedDomain("nonurs.tld");
persistResource(
new DomainHistory.Builder()
.setBySuperuser(true)
.setClientId("adminreg")
.setDomain(nonUrsDomain)
.setType(HistoryEntry.Type.DOMAIN_UPDATE)
.setRequestedByRegistrar(false)
.setModificationTime(ursTime)
.build());
fakeClock.advanceBy(Duration.standardDays(10));
runCommandForced(