package com.networknt.utility;

import org.junit.Assert;
import org.junit.Test;

/**
 * Created by stevehu on 2016-12-23.
 */
public class HashUtilTest {
    @Test
    public void testMd5Hex() {
        String md5 = HashUtil.md5Hex("stevehu@gmail.com");
        Assert.assertEquals(md5, "417bed6d9644f12d8bc709059c225c27");
    }
    @Test
    public void testPasswordHash() throws Exception {
        String password = "123456";
        String hashedPass = HashUtil.generateStorngPasswordHash(password);
        System.out.println("hashedPass = " + hashedPass);
        Assert.assertTrue(HashUtil.validatePassword(password, hashedPass));
    }

}

@@ -639,10 +639,342 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void testClientSecretHash() throws Exception %7B%0A        String secret = %22f6h1FTI8Q3-7UScPZDzfXA%22;%0A        String hashedPass = HashUtil.generateStorngPasswordHash(secret);%0A        System.out.println(%22hashedSecret = %22 + hashedPass);%0A        Assert.assertTrue(HashUtil.validatePassword(secret, hashedPass));%0A    %7D%0A%0A
 %7D%0A

update test case to generate ahash for client secret