package com.ruoyi.loanpricing.domain.entity;

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

import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.Set;
import java.util.stream.Collectors;
import org.junit.jupiter.api.Test;

class ModelRetailOutputFieldsTest
{
    @Test
    void shouldContainLatestRetailDisplayRateFields()
    {
        Set<String> fieldNames = Arrays.stream(ModelRetailOutputFields.class.getDeclaredFields())
                .map(Field::getName)
                .collect(Collectors.toSet());

        assertTrue(fieldNames.contains("loanRateHistory"), "缺少字段 loanRateHistory");
        assertTrue(fieldNames.contains("minRateProduct"), "缺少字段 minRateProduct");
        assertTrue(fieldNames.contains("smoothRange"), "缺少字段 smoothRange");
        assertTrue(fieldNames.contains("finalCalculateRate"), "缺少字段 finalCalculateRate");
        assertTrue(fieldNames.contains("referenceRate"), "缺少字段 referenceRate");
        assertTrue(fieldNames.contains("greyBlackCust"), "缺少字段 greyBlackCust");
    }
}
