Skip to content

Commit 50dfc34

Browse files
committed
fix: JasyptTest 테스트코드 yml 의존성 제거
1 parent 4229c2a commit 50dfc34

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

src/test/kotlin/com/yapp2app/JasyptTest.kt

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
package com.yapp2app
22

3-
import org.jasypt.encryption.StringEncryptor
3+
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor
4+
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig
45
import org.junit.jupiter.api.Test
5-
import org.springframework.beans.factory.annotation.Autowired
6-
import org.springframework.boot.test.context.SpringBootTest
76
import org.springframework.test.context.ActiveProfiles
87

9-
@SpringBootTest
108
@ActiveProfiles("test")
11-
class JasyptTest(@Autowired private val jasyptStringEncryptor: StringEncryptor) {
9+
class JasyptTest {
10+
11+
private val jasyptStringEncryptor = PooledPBEStringEncryptor().apply {
12+
setConfig(
13+
SimpleStringPBEConfig().apply {
14+
password = "testPasswordForJasypt"
15+
algorithm = "PBEWithHmacSHA512AndAES_256"
16+
setKeyObtentionIterations("1000")
17+
setPoolSize("1")
18+
providerName = "SunJCE"
19+
setSaltGeneratorClassName("org.jasypt.salt.RandomSaltGenerator")
20+
setIvGeneratorClassName("org.jasypt.iv.RandomIvGenerator")
21+
stringOutputType = "base64"
22+
},
23+
)
24+
}
1225

1326
@Test
1427
fun jasyptGeneratTest() {
1528
println("=== Jasypt 암호화 유틸리티 ===")
1629
println()
1730

1831
// 기타 암호화할 값
19-
val text = "2uYKrIx7hFeZDoEyiXvWSY29TvSGfevQ"
32+
val text = "test_text"
2033
val encryptedText = jasyptStringEncryptor.encrypt(text)
2134
println(" 원본: $text")
2235
println(" 암호화: ENC($encryptedText)")

0 commit comments

Comments
 (0)