ZhuDongming
2019-08-08 90a6386cda8e3356c23f283656bf94e21e94b46a
src/test/java/com/moral/ScreenApiApplicationTests.java
@@ -3,7 +3,10 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
@RunWith(SpringRunner.class)
@SpringBootTest
@@ -12,5 +15,16 @@
   @Test
   public void contextLoads() {
   }
   @Resource
   private BCryptPasswordEncoder encoder;
   @Test
   public void testEncoder(){
      String hash = encoder.encode("123456");
      System.out.printf("\n============================\n");
      System.out.printf("hash:"+hash);
//      Boolean result = encoder.matches("123456",hash);
//      System.out.printf("result:"+result);
      System.out.printf("\n============================\n");
   }
}