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; }
public void testIfAlgorithmExists() { System.out.println("Test if MD algorithm exists."); assert PasswordHasher.algorithmExists(); }