mirror of
https://github.com/google/nomulus
synced 2026-05-21 23:31:51 +00:00
Make return value of ClaimsListShard.getClaimKey() Optional
It was nullable all along, but wasn't tagged as such, and thus it was possible to misuse the method from its call sites. Also adds an assertion about no NORDN tasks being enqueued in a failing domain create test for a required signed mark. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=187649865
This commit is contained in:
@@ -50,6 +50,7 @@ import google.registry.model.tmch.ClaimsListShard;
|
||||
import google.registry.util.Clock;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import javax.inject.Inject;
|
||||
import org.joda.time.DateTime;
|
||||
@@ -109,10 +110,10 @@ public final class DomainClaimsCheckFlow implements Flow {
|
||||
verifyClaimsPeriodNotEnded(registry, now);
|
||||
}
|
||||
}
|
||||
String claimKey = ClaimsListShard.get().getClaimKey(domainName.parts().get(0));
|
||||
Optional<String> claimKey = ClaimsListShard.get().getClaimKey(domainName.parts().get(0));
|
||||
launchChecksBuilder.add(
|
||||
LaunchCheck.create(
|
||||
LaunchCheckName.create(claimKey != null, targetId), claimKey));
|
||||
LaunchCheckName.create(claimKey.isPresent(), targetId), claimKey.orElse(null)));
|
||||
}
|
||||
return responseBuilder
|
||||
.setOnlyExtension(LaunchCheckResponseExtension.create(CLAIMS, launchChecksBuilder.build()))
|
||||
|
||||
Reference in New Issue
Block a user