Skip to content

Commit

Permalink
[#132] test(AES256Util)
Browse files Browse the repository at this point in the history
- 암호화가 제대로 되는지 확인한다.
- 복호화가 제대로 되는지 확인한다.
  • Loading branch information
Ji-Ha committed May 11, 2022
1 parent 172ffbb commit 5108325
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/test/kotlin/com/yapp/web2/util/AES256UtilTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.yapp.web2.util

import org.assertj.core.api.Assertions
import org.junit.jupiter.api.Test

internal class AES256UtilTest {

private val aeS256Util = AES256Util("1234567891123412342345678")

@Test
fun `암호화가 제대로 되는지 확인한다`() {
// given
val testString = "testString"

// when
val actual = aeS256Util.encrypt(testString)

// then
println(actual)
Assertions.assertThat(actual).isNotNull
}

@Test
fun `복호화가 제대로 되는지 확인한다`() {
//given
val testString = "testString"
val testEncryptString = aeS256Util.encrypt(testString)

//when
val actual = aeS256Util.decrypt(testEncryptString)

//then
Assertions.assertThat(actual).isEqualTo(testString)
}
}

0 comments on commit 5108325

Please sign in to comment.