From 5108325eb522f6db023082e13d8a75d976f505aa Mon Sep 17 00:00:00 2001 From: Ji-Ha Date: Wed, 11 May 2022 16:43:19 +0900 Subject: [PATCH] =?UTF-8?q?[#132]=20test(AES256Util)=20-=20=EC=95=94?= =?UTF-8?q?=ED=98=B8=ED=99=94=EA=B0=80=20=EC=A0=9C=EB=8C=80=EB=A1=9C=20?= =?UTF-8?q?=EB=90=98=EB=8A=94=EC=A7=80=20=ED=99=95=EC=9D=B8=ED=95=9C?= =?UTF-8?q?=EB=8B=A4.=20-=20=EB=B3=B5=ED=98=B8=ED=99=94=EA=B0=80=20?= =?UTF-8?q?=EC=A0=9C=EB=8C=80=EB=A1=9C=20=EB=90=98=EB=8A=94=EC=A7=80=20?= =?UTF-8?q?=ED=99=95=EC=9D=B8=ED=95=9C=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yapp/web2/util/AES256UtilTest.kt | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/test/kotlin/com/yapp/web2/util/AES256UtilTest.kt diff --git a/src/test/kotlin/com/yapp/web2/util/AES256UtilTest.kt b/src/test/kotlin/com/yapp/web2/util/AES256UtilTest.kt new file mode 100644 index 00000000..084ed571 --- /dev/null +++ b/src/test/kotlin/com/yapp/web2/util/AES256UtilTest.kt @@ -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) + } +}