Browse Source
Merge in TC/finekit from ~ZED/finekit:master to master * commit '420bc83904e95c31570d4d8648d0de0423c3ef60': DEC-15861 feat: Fr/Bi融合与独立部署V1 DEC-15861 feat: Fr/Bi融合与独立部署V1pull/3/head
zed
4 years ago
2 changed files with 51 additions and 4 deletions
@ -1,18 +1,25 @@ |
|||||||
package com.fanruan.api.security; |
package com.fanruan.api.security; |
||||||
|
|
||||||
import java.util.*; |
|
||||||
|
|
||||||
import com.fr.stable.CommonCodeUtils; |
import com.fr.stable.CommonCodeUtils; |
||||||
import org.junit.Assert; |
import org.junit.Assert; |
||||||
import org.junit.Test; |
import org.junit.Test; |
||||||
|
|
||||||
public class SecurityKitTest { |
public class SecurityKitTest { |
||||||
|
|
||||||
@Test |
@Test |
||||||
public void passwordDecode() { |
public void passwordDecode() { |
||||||
Assert.assertEquals(SecurityKit.passwordDecode("1234"), CommonCodeUtils.passwordDecode("1234")); |
Assert.assertEquals(SecurityKit.passwordDecode("1234"), CommonCodeUtils.passwordDecode("1234")); |
||||||
} |
} |
||||||
|
|
||||||
@Test |
@Test |
||||||
public void passwordEncode() { |
public void passwordEncode() { |
||||||
Assert.assertEquals(SecurityKit.passwordEncode("1234"), CommonCodeUtils.passwordEncode("1234")); |
Assert.assertEquals(SecurityKit.passwordEncode("1234"), CommonCodeUtils.passwordEncode("1234")); |
||||||
} |
} |
||||||
|
|
||||||
|
@Test |
||||||
|
public void aes() { |
||||||
|
String seed = SecurityKit.createSeed(); |
||||||
|
String text = SecurityKit.aesEncrypt("zed", seed); |
||||||
|
Assert.assertEquals("zed", SecurityKit.aesDecrypt(text, seed)); |
||||||
|
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue