From ea2a6165e534d299de4a9a1c751c0eed0b98d966 Mon Sep 17 00:00:00 2001 From: gbrodman Date: Mon, 24 Aug 2020 13:08:45 -0400 Subject: [PATCH] Fix AllocationTokenTest (#779) --- .../registry/model/domain/token/AllocationTokenTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/test/java/google/registry/model/domain/token/AllocationTokenTest.java b/core/src/test/java/google/registry/model/domain/token/AllocationTokenTest.java index f9f43945f..455b69806 100644 --- a/core/src/test/java/google/registry/model/domain/token/AllocationTokenTest.java +++ b/core/src/test/java/google/registry/model/domain/token/AllocationTokenTest.java @@ -224,11 +224,13 @@ public class AllocationTokenTest extends EntityTestCase { @Test void testBuild_redemptionHistoryEntryOnlyInSingleUse() { + DomainBase domain = persistActiveDomain("blahdomain.foo"); + Key historyEntryKey = Key.create(Key.create(domain), HistoryEntry.class, 1); AllocationToken.Builder builder = new AllocationToken.Builder() .setToken("foobar") .setTokenType(TokenType.UNLIMITED_USE) - .setRedemptionHistoryEntry(VKey.create(HistoryEntry.class, 1L)); + .setRedemptionHistoryEntry(VKey.create(HistoryEntry.class, 1L, historyEntryKey)); IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build); assertThat(thrown) .hasMessageThat()