diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-02-10 19:09:45 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-02-10 19:12:27 +0100 |
commit | f2db48bd6fa9a0e5eaccaf696bc0e2dcba46bfe6 (patch) | |
tree | 7c5add4492ddaa4772cd425081638b7cf41fab01 /sonar-home/src/test | |
parent | abb950335228f128939a69a52bf090782623459f (diff) | |
download | sonarqube-f2db48bd6fa9a0e5eaccaf696bc0e2dcba46bfe6.tar.gz sonarqube-f2db48bd6fa9a0e5eaccaf696bc0e2dcba46bfe6.zip |
SONAR-2291 lower-case hash
Diffstat (limited to 'sonar-home/src/test')
-rw-r--r-- | sonar-home/src/test/java/org/sonar/home/cache/FileHashesTest.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sonar-home/src/test/java/org/sonar/home/cache/FileHashesTest.java b/sonar-home/src/test/java/org/sonar/home/cache/FileHashesTest.java index ff6c01c7a3e..e7d7ed98d76 100644 --- a/sonar-home/src/test/java/org/sonar/home/cache/FileHashesTest.java +++ b/sonar-home/src/test/java/org/sonar/home/cache/FileHashesTest.java @@ -47,27 +47,27 @@ public class FileHashesTest { @Test public void test_md5_hash() { - assertThat(hash("sonar")).isEqualTo("D85E336D61F5344395C42126FAC239BC"); + assertThat(hash("sonar")).isEqualTo("d85e336d61f5344395c42126fac239bc"); // compare results with commons-codec for (int index = 0; index < 100; index++) { String random = randomString(); assertThat(hash(random)).as(random).isEqualTo( - DigestUtils.md5Hex(random).toUpperCase() + DigestUtils.md5Hex(random).toLowerCase() ); } } @Test public void test_toHex() { - // upper-case - assertThat(FileHashes.toHex("aloa_bi_bop_a_loula".getBytes())).isEqualTo("616C6F615F62695F626F705F615F6C6F756C61"); + // lower-case + assertThat(FileHashes.toHex("aloa_bi_bop_a_loula".getBytes())).isEqualTo("616c6f615f62695f626f705f615f6c6f756c61"); // compare results with commons-codec for (int index = 0; index < 100; index++) { String random = randomString(); assertThat(FileHashes.toHex(random.getBytes())).as(random).isEqualTo( - Hex.encodeHexString(random.getBytes()).toUpperCase() + Hex.encodeHexString(random.getBytes()).toLowerCase() ); } } |