Fix AllocationTokenTest (#779)

This commit is contained in:
gbrodman 2020-08-24 13:08:45 -04:00 committed by GitHub
parent c36f0c89c8
commit ea2a6165e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -224,11 +224,13 @@ public class AllocationTokenTest extends EntityTestCase {
@Test
void testBuild_redemptionHistoryEntryOnlyInSingleUse() {
DomainBase domain = persistActiveDomain("blahdomain.foo");
Key<HistoryEntry> 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()