mirror of
https://github.com/google/nomulus.git
synced 2025-07-07 03:33:28 +02:00
Fix AllocationTokenTest (#779)
This commit is contained in:
parent
c36f0c89c8
commit
ea2a6165e5
1 changed files with 3 additions and 1 deletions
|
@ -224,11 +224,13 @@ public class AllocationTokenTest extends EntityTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testBuild_redemptionHistoryEntryOnlyInSingleUse() {
|
void testBuild_redemptionHistoryEntryOnlyInSingleUse() {
|
||||||
|
DomainBase domain = persistActiveDomain("blahdomain.foo");
|
||||||
|
Key<HistoryEntry> historyEntryKey = Key.create(Key.create(domain), HistoryEntry.class, 1);
|
||||||
AllocationToken.Builder builder =
|
AllocationToken.Builder builder =
|
||||||
new AllocationToken.Builder()
|
new AllocationToken.Builder()
|
||||||
.setToken("foobar")
|
.setToken("foobar")
|
||||||
.setTokenType(TokenType.UNLIMITED_USE)
|
.setTokenType(TokenType.UNLIMITED_USE)
|
||||||
.setRedemptionHistoryEntry(VKey.create(HistoryEntry.class, 1L));
|
.setRedemptionHistoryEntry(VKey.create(HistoryEntry.class, 1L, historyEntryKey));
|
||||||
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
|
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
|
||||||
assertThat(thrown)
|
assertThat(thrown)
|
||||||
.hasMessageThat()
|
.hasMessageThat()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue