package com.ruoyi.info.collection.mapper;

import org.junit.jupiter.api.Test;

import java.io.InputStream;
import java.nio.charset.StandardCharsets;

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

class CcdiEnterpriseBaseInfoMapperTest {

    @Test
    void mapperXml_shouldContainPageQueryAndImportColumns() throws Exception {
        try (InputStream inputStream = getClass().getClassLoader()
                .getResourceAsStream("mapper/info/collection/CcdiEnterpriseBaseInfoMapper.xml")) {
            String xml = new String(inputStream.readAllBytes(), StandardCharsets.UTF_8);

            assertTrue(xml.contains("selectEnterpriseBaseInfoPage"), xml);
            assertTrue(xml.contains("risk_level"), xml);
            assertTrue(xml.contains("ent_source"), xml);
            assertTrue(xml.contains("data_source"), xml);
            assertTrue(xml.contains("ORDER BY create_time DESC"), xml);
        }
    }
}
