Skip to content

Commit

Permalink
Implement test for getUUIDHash()
Browse files Browse the repository at this point in the history
  • Loading branch information
zHd4 committed Dec 5, 2024
1 parent 2d828a5 commit 6307028
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/src/test/java/app/notesr/utils/HashHelperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Random;
import java.util.UUID;

public class HashHelperTest {

Expand All @@ -22,4 +23,14 @@ public void testSha256Bytes() throws NoSuchAlgorithmException {

Assert.assertArrayEquals("Actual hash different", expected, actual);
}

@Test
public void testGetUUIDHash() {
UUID uuid = UUID.fromString("123e4567-e89b-12d3-a456-426614174000");

long expected = 3121068470L;
long actual = HashHelper.getUUIDHash(uuid);

Assert.assertEquals("Actual hash different", expected, actual);
}
}

0 comments on commit 6307028

Please sign in to comment.