Ejemplo n.º 1
0
 public void testIfHashingWorks() {
   System.out.println("Test if hashing works.");
   boolean failed = false;
   try {
     PasswordHasher.init();
     assert PasswordHasher.generateHash("test").equals("a94a8fe5ccb19ba61c4c0873d391e987982fbbd3");
   } catch (NoSuchAlgorithmException ex) {
     failed = true;
   }
   assert !failed;
 }
Ejemplo n.º 2
0
 public void testIfAlgorithmExists() {
   System.out.println("Test if MD algorithm exists.");
   assert PasswordHasher.algorithmExists();
 }