Skip to content

Commit 50a9f12

Browse files
committed
test: 添加jasypt测试类用于生成配置项
1 parent b86e5b9 commit 50a9f12

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package top.cadecode.uniboot;
2+
3+
import org.jasypt.encryption.StringEncryptor;
4+
import org.junit.jupiter.api.Test;
5+
import org.springframework.beans.factory.annotation.Autowired;
6+
import org.springframework.boot.test.context.SpringBootTest;
7+
8+
/**
9+
* 用于生成加密配置的测试工具
10+
*
11+
* @author Cade Li
12+
* @since 2023/4/24
13+
*/
14+
@SpringBootTest
15+
public class JasyptEncryptorTest {
16+
17+
@Autowired
18+
private StringEncryptor stringEncryptor;
19+
20+
@Test
21+
void encrypt() {
22+
// 执行加密前需要在配置文件中配置jasypt.encryptor.password
23+
stringEncryptor.encrypt("string waiting encrypt");
24+
}
25+
26+
}

0 commit comments

Comments
 (0)