mirror of
https://github.com/google/nomulus
synced 2026-09-18 22:14:23 +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:
@@ -15,6 +15,7 @@
|
||||
package google.registry.tmch;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth8.assertThat;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
@@ -36,7 +37,7 @@ public class TmchDnlActionTest extends TmchActionTestCase {
|
||||
|
||||
@Test
|
||||
public void testDnl() throws Exception {
|
||||
assertThat(ClaimsListShard.get().getClaimKey("xn----7sbejwbn3axu3d")).isNull();
|
||||
assertThat(ClaimsListShard.get().getClaimKey("xn----7sbejwbn3axu3d")).isEmpty();
|
||||
when(httpResponse.getContent())
|
||||
.thenReturn(TmchTestData.loadBytes("dnl-latest.csv").read())
|
||||
.thenReturn(TmchTestData.loadBytes("dnl-latest.sig").read());
|
||||
@@ -51,7 +52,7 @@ public class TmchDnlActionTest extends TmchActionTestCase {
|
||||
ClaimsListShard claimsList = ClaimsListShard.get();
|
||||
assertThat(claimsList.getCreationTime()).isEqualTo(DateTime.parse("2013-11-24T23:15:37.4Z"));
|
||||
assertThat(claimsList.getClaimKey("xn----7sbejwbn3axu3d"))
|
||||
.isEqualTo("2013112500/7/4/8/dIHW0DiuybvhdP8kIz");
|
||||
assertThat(claimsList.getClaimKey("lolcat")).isNull();
|
||||
.hasValue("2013112500/7/4/8/dIHW0DiuybvhdP8kIz");
|
||||
assertThat(claimsList.getClaimKey("lolcat")).isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user