/sigmah/src/test/java/org/sigmah/server/auth/BCryptTest.java
http://sigma-h.googlecode.com/ · Java · 36 lines · 22 code · 10 blank · 4 comment · 0 complexity · cb90b4f2508bdfeee078f7e824cce8ad MD5 · raw file
- /*
- * All Sigmah code is released under the GNU General Public License v3
- * See COPYRIGHT.txt and LICENSE.txt.
- */
-
- package org.sigmah.server.auth;
-
- import org.junit.Ignore;
- import org.junit.Test;
- import org.sigmah.server.auth.impl.BCrypt;
-
- import static org.junit.Assert.assertTrue;
-
- public class BCryptTest {
-
- @Test
- public void realityCheck() {
-
- String input = "Hello world";
-
- String hashed = BCrypt.hashpw(input, BCrypt.gensalt());
-
- assertTrue(BCrypt.checkpw(input, hashed));
- }
-
- @Test
- @Ignore("for generating sample dbunit files only")
- public void generateSamples() {
- printSample("monday");
- printSample("tuesday");
- }
-
- private void printSample(String password) {
- System.out.println(password + " = " + BCrypt.hashpw(password, BCrypt.gensalt()));
- }
- }