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

import com.cf.imes.framework.test.core.ut.BaseMockitoUnitTest;
import com.cf.imes.module.system.enums.config.SystemConfigTypeEnum;
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 9:54
 */
class SystemConfigTypeEnumValidatorTest extends BaseMockitoUnitTest {
    @Mock
    private ConstraintValidatorContext constraintValidatorContext;

    @Test
    void testValid() {
        SystemConfigTypeEnumValidator validator = new SystemConfigTypeEnumValidator();
        assertTrue(validator.isValid(SystemConfigTypeEnum.CUSTOM_PLATE_NO.getType(), constraintValidatorContext));
        assertTrue(validator.isValid(SystemConfigTypeEnum.INTELLIGENT_BRANCH.getType(), constraintValidatorContext));
        assertTrue(validator.isValid(SystemConfigTypeEnum.PROCESSING_SCREENING.getType(), constraintValidatorContext));
        assertTrue(validator.isValid(SystemConfigTypeEnum.DATA_PROCESSING.getType(), constraintValidatorContext));
        assertTrue(validator.isValid(SystemConfigTypeEnum.PROCESS_SCHEME.getType(), constraintValidatorContext));
        assertTrue(validator.isValid(SystemConfigTypeEnum.SEALEDGE.getType(), constraintValidatorContext));
        assertTrue(validator.isValid(null, constraintValidatorContext));
        assertFalse(validator.isValid(100, constraintValidatorContext));
    }
}
