mirror of
https://github.com/google/nomulus.git
synced 2025-07-02 01:03:33 +02:00
Add test for wrong bucketId order in CommitLogCheckpoint.create
Added to make it clear that the order of the keys in the map is important. A better solution would be, of course, to make the order unimportant. This can be done by using ImmutableSortedMap either as input or with copyOf the input. But the create function is only used once, so it doesn't seem worth the effort - as long as we make sure to throw an error if the order is wrong. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=164515959
This commit is contained in:
parent
e786c8d6ff
commit
1ca6c95dc2
1 changed files with 6 additions and 0 deletions
|
@ -75,4 +75,10 @@ public class CommitLogCheckpointTest {
|
||||||
thrown.expect(IllegalArgumentException.class, "Bucket ids are incorrect");
|
thrown.expect(IllegalArgumentException.class, "Bucket ids are incorrect");
|
||||||
CommitLogCheckpoint.create(DateTime.now(UTC), ImmutableMap.of(0, T1, 1, T2, 2, T3));
|
CommitLogCheckpoint.create(DateTime.now(UTC), ImmutableMap.of(0, T1, 1, T2, 2, T3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test_create_wrongBucketIdOrder_throws() {
|
||||||
|
thrown.expect(IllegalArgumentException.class, "Bucket ids are incorrect");
|
||||||
|
CommitLogCheckpoint.create(DateTime.now(UTC), ImmutableMap.of(2, T2, 1, T1, 3, T3));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue