package kr.xit.core.spring.util;

import static org.assertj.core.api.Assertions.assertThat;

import kr.xit.core.spring.test.BaseIntegrationTest;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;


@Slf4j
class AES128ConfigTest extends BaseIntegrationTest {

    @Autowired
    private AES128Config aes128Config;

    @Test
    @DisplayName("Aes128 암호화가 잘 이루어지는지 테스트")
    void aes128Test() {
        String text = "this is test";
        String enc = aes128Config.encryptAes(text);
        String dec = aes128Config.decryptAes(enc);
        log.info("enc = {}", enc);
        log.info("dec = {}", dec);

        assertThat(dec).isEqualTo(text);
    }
}
