package cn.hnthyy.thmz;

import cn.hnthyy.thmz.Utils.Md5Util;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;

@RunWith(SpringRunner.class)
@SpringBootTest
public class ThmzApplicationTests {

    @Test
    public void contextLoads() throws UnsupportedEncodingException, NoSuchAlgorithmException {
        String str = "1";
        try {
            String newString = Md5Util.encoderByMd5(str);
            System.out.println(newString);
        } catch (NoSuchAlgorithmException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (UnsupportedEncodingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        System.out.println( Md5Util.checkPassword("1","xMpCOKC5I4INzFCab3WEmw=="));

    }
}

