Files
junhong_cmp_fiber/internal/query/pollingalert/stop_refused_columns_test.go
邹进 226a15573a
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 1h20m10s
fix: 观测序列与拒绝停机告警读取 ICCID 时显式指定列名
GORM 默认把字段 ICCID 映射成 icc_id:
- 观测序列设备换卡的本地预期判定读不到当前卡 ICCID,永远判不成立,只能靠调网关重试到上限
- 拒绝停机告警列表 ICCID 一直为空
补列名测试防回归。
2026-11-07 17:39:46 +09:00

21 lines
560 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package pollingalert
import (
"sync"
"testing"
"gorm.io/gorm/schema"
)
// GORM 默认把字段 ICCID 映射成 icc_id;查询选的是 a.iccid,必须显式指定列名,否则列表 ICCID 一直为空。
func TestStopRefusedRowICCIDColumn(t *testing.T) {
s, err := schema.Parse(&StopRefusedRow{}, &sync.Map{}, schema.NamingStrategy{})
if err != nil {
t.Fatalf("parse StopRefusedRow: %v", err)
}
field := s.LookUpField("ICCID")
if field == nil || field.DBName != "iccid" {
t.Fatalf("StopRefusedRow.ICCID column = %v, want iccid", field)
}
}