package com.cloudhandson.vpdbackoffice.domain.masking;

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

import org.junit.jupiter.api.Test;

class MaskingTemplateTest {

  @Test
  void exposesOnlyCuratedTemplates() {
    assertThat(MaskingTemplate.from("rrn_partial"))
        .isEqualTo(MaskingTemplate.RRN_PARTIAL);
    assertThat(MaskingTemplate.FULL.asoFunction())
        .isEqualTo("DBMS_REDACT.FULL");
    assertThat(MaskingTemplate.NULLIFY.previewResult())
        .isEqualTo("NULL");
  }

  @Test
  void rejectsUnknownTemplateCode() {
    assertThatThrownBy(() -> MaskingTemplate.from("RAW_SQL"))
        .isInstanceOf(IllegalArgumentException.class)
        .hasMessageContaining("지원하지 않는");
  }
}
