package com.yimeng.okr.config;

import com.yimeng.okr.exception.BusinessException;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertThrows;

class ProductionStartupValidatorTest {

    @Test
    void rejectsDefaultJwtSecretInProduction() {
        ProductionStartupValidator validator = new ProductionStartupValidator(
                "yimeng-ai-okr-secret-key-2026-must-be-at-least-256-bits-long",
                "strong-admin-password",
                "https://okr.example.com");

        assertThrows(BusinessException.class, validator::validate);
    }

    @Test
    void rejectsDefaultSuperAdminPasswordInProduction() {
        ProductionStartupValidator validator = new ProductionStartupValidator(
                "a-production-secret-that-is-long-enough-2026",
                "emoon123456",
                "https://okr.example.com");

        assertThrows(BusinessException.class, validator::validate);
    }
}
