@VisibleForTesting
    void validateTableInfo(TableInfo tableInfo) {
        if (tableInfo == null) {
            throw exception(CODEGEN_IMPORT_TABLE_NULL);
        }
        if (StrUtil.isEmpty(tableInfo.getComment())) {
            throw exception(CODEGEN_TABLE_INFO_TABLE_COMMENT_IS_NULL);
        }
        if (CollUtil.isEmpty(tableInfo.getFields())) {
            throw exception(CODEGEN_IMPORT_COLUMNS_NULL);
        }
        tableInfo.getFields().forEach(field -> {
            if (StrUtil.isEmpty(field.getComment())) {
                throw exception(CODEGEN_TABLE_INFO_COLUMN_COMMENT_IS_NULL, field.getName());
            }
        });
    }
@Test
    public void testValidateTableInfo() {
        // 情况一
        assertServiceException(() -> codegenService.validateTableInfo(null),
                CODEGEN_IMPORT_TABLE_NULL);
        // 情况二
        TableInfo tableInfo = mock(TableInfo.class);
        assertServiceException(() -> codegenService.validateTableInfo(tableInfo),
                CODEGEN_TABLE_INFO_TABLE_COMMENT_IS_NULL);
        // 情况三
        when(tableInfo.getComment()).thenReturn("芋艿");
        assertServiceException(() -> codegenService.validateTableInfo(tableInfo),
                CODEGEN_IMPORT_COLUMNS_NULL);
        // 情况四
        TableField field = mock(TableField.class);
        when(field.getName()).thenReturn("name");
        when(tableInfo.getFields()).thenReturn(Collections.singletonList(field));
        assertServiceException(() -> codegenService.validateTableInfo(tableInfo),
                CODEGEN_TABLE_INFO_COLUMN_COMMENT_IS_NULL, field.getName());
    }