From 2d0b1b3da347f201cfe608e426fb2b7fdb9629a7 Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Fri, 17 Aug 2018 17:13:27 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/test/java/com/moral/ScreenApiApplicationTests.java | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/test/java/com/moral/ScreenApiApplicationTests.java b/src/test/java/com/moral/ScreenApiApplicationTests.java
index 0dbf23c..35846f3 100644
--- a/src/test/java/com/moral/ScreenApiApplicationTests.java
+++ b/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");
+ }
}
--
Gitblit v1.8.0