Browse Source

DEC-15861 feat: Fr/Bi融合与独立部署V1

pull/3/head
zed 4 years ago
parent
commit
420bc83904
  1. 7
      src/test/java/com/fanruan/api/security/SecurityKitTest.java

7
src/test/java/com/fanruan/api/security/SecurityKitTest.java

@ -1,11 +1,11 @@
package com.fanruan.api.security; package com.fanruan.api.security;
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"));
@ -18,7 +18,8 @@ public class SecurityKitTest {
@Test @Test
public void aes() { public void aes() {
String text = SecurityKit.aesEncrypt("zed", "IrgwAINYUSLqVxHL"); String seed = SecurityKit.createSeed();
Assert.assertEquals("zed", SecurityKit.aesDecrypt(text, "IrgwAINYUSLqVxHL")); String text = SecurityKit.aesEncrypt("zed", seed);
Assert.assertEquals("zed", SecurityKit.aesDecrypt(text, seed));
} }
} }

Loading…
Cancel
Save