]> WPIA git - gigi.git/blob - tests/org/cacert/gigi/util/TestPasswordHash.java
[EMPTY] Formatting with configured formatter.
[gigi.git] / tests / org / cacert / gigi / util / TestPasswordHash.java
1 package org.cacert.gigi.util;
2
3 import org.junit.Test;
4 import static org.junit.Assert.*;
5
6 public class TestPasswordHash {
7         @Test
8         public void testVerify() {
9                 assertTrue(PasswordHash.verifyHash("a", PasswordHash.hash("a")));
10                 assertTrue(PasswordHash.verifyHash("", PasswordHash.hash("")));
11                 assertTrue(PasswordHash.verifyHash("a1234", PasswordHash.hash("a1234")));
12                 assertTrue(PasswordHash.verifyHash("auhlcb4 9x,IUQẞ&lvrvä", PasswordHash.hash("auhlcb4 9x,IUQẞ&lvrvä")));
13         }
14
15         @Test
16         public void testVerifyNegative() {
17                 assertFalse(PasswordHash.verifyHash("b", PasswordHash.hash("a")));
18                 assertFalse(PasswordHash.verifyHash("ae", PasswordHash.hash("auhlcb4 9x,IUQẞ&lvrvä")));
19         }
20 }