mirror of
https://github.com/google/nomulus
synced 2026-01-11 08:20:27 +00: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:
@@ -75,4 +75,10 @@ public class CommitLogCheckpointTest {
|
||||
thrown.expect(IllegalArgumentException.class, "Bucket ids are incorrect");
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user