package com.cf.imes.module.system.validation.label;

import com.cf.imes.framework.test.core.ut.BaseMockitoUnitTest;
import com.cf.imes.module.system.enums.label.LabelTemplateType;
import jakarta.validation.ConstraintValidatorContext;
import org.junit.jupiter.api.Test;
import org.mockito.Mock;

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
 * @author Gqr
 * @since 2025/10/29 10:13
 */
class LabelTemplateTypeValidatorTest  extends BaseMockitoUnitTest {
    @Mock
    private ConstraintValidatorContext constraintValidatorContext;

    @Test
    void testValid() {
        LabelTemplateTypeValidator validator = new LabelTemplateTypeValidator();
        assertTrue(validator.isValid(LabelTemplateType.ORDERPACKAGELABEL.getType(), constraintValidatorContext));
        assertTrue(validator.isValid(LabelTemplateType.MATERIALLABEL.getType(), constraintValidatorContext));
        assertTrue(validator.isValid("", constraintValidatorContext));
        assertFalse(validator.isValid("100", constraintValidatorContext));
    }
}