mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add test
This commit is contained in:
parent
3227ea0979
commit
574b657854
@ -19,9 +19,7 @@ package org.dromara.hutool.crypto.symmetric;
|
|||||||
import org.dromara.hutool.core.codec.binary.Base64;
|
import org.dromara.hutool.core.codec.binary.Base64;
|
||||||
import org.dromara.hutool.core.codec.binary.HexUtil;
|
import org.dromara.hutool.core.codec.binary.HexUtil;
|
||||||
import org.dromara.hutool.core.util.RandomUtil;
|
import org.dromara.hutool.core.util.RandomUtil;
|
||||||
import org.dromara.hutool.crypto.KeyUtil;
|
import org.dromara.hutool.crypto.*;
|
||||||
import org.dromara.hutool.crypto.Mode;
|
|
||||||
import org.dromara.hutool.crypto.Padding;
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
import org.junit.jupiter.api.Assertions;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
@ -148,4 +146,10 @@ public class AESTest {
|
|||||||
final String decryptStr = aes.decryptStr(encrypt);
|
final String decryptStr = aes.decryptStr(encrypt);
|
||||||
Assertions.assertEquals(phone, decryptStr);
|
Assertions.assertEquals(phone, decryptStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void issue3766Test() {
|
||||||
|
Assertions.assertThrows(CryptoException.class, ()->
|
||||||
|
SecureUtil.aes("8888888888888888".getBytes()).decryptStr("哈哈"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user