-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from Seasoning-Today/crypto-ver2
기록장 암호화 재적용 외 기타 작업
- Loading branch information
Showing
5 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/test/java/today/seasoning/seasoning/CipherUtilTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package today.seasoning.seasoning; | ||
|
||
import org.assertj.core.api.SoftAssertions; | ||
import org.assertj.core.api.junit.jupiter.InjectSoftAssertions; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import today.seasoning.seasoning.common.cipher.CipherUtil; | ||
|
||
public class CipherUtilTest extends BaseIntegrationTest { | ||
|
||
@Autowired | ||
CipherUtil cipherUtil; | ||
|
||
@InjectSoftAssertions | ||
SoftAssertions softAssertions; | ||
|
||
@Test | ||
@DisplayName("암복호화 테스트") | ||
void test() { | ||
try { | ||
String content = "abc"; | ||
String encoded = cipherUtil.encode(content); | ||
String decoded = cipherUtil.decode(encoded); | ||
softAssertions.assertThat(content).isNotEqualTo(encoded); | ||
softAssertions.assertThat(decoded).isEqualTo(content); | ||
} catch (Exception e) { | ||
softAssertions.fail(e.getMessage()); | ||
} | ||
} | ||
|
||
} |