sync: 同步 v1.0.4 并脱敏配置与镜像
This commit is contained in:
@@ -2,9 +2,9 @@ package unsub
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/library/batchimport"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/library/batchinput/excel"
|
||||
"io"
|
||||
)
|
||||
|
||||
func ParseExcelFileRows(ctx context.Context, filePath string) ([]batchimport.Row, error) {
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package unsub
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/library/batchimport"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model"
|
||||
)
|
||||
|
||||
func TestProcessorConfigTemplateHeaders(t *testing.T) {
|
||||
config := NewProcessor().Config()
|
||||
expected := []string{"ICCID", "MSISDN", "IMSI"}
|
||||
if len(config.TemplateHeaders) != len(expected) {
|
||||
t.Fatalf("unexpected template header count: got %d want %d", len(config.TemplateHeaders), len(expected))
|
||||
}
|
||||
for i, header := range expected {
|
||||
if config.TemplateHeaders[i] != header {
|
||||
t.Fatalf("unexpected template header at %d: got %q want %q", i, config.TemplateHeaders[i], header)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildBatchInfoExcelDoesNotIncludeRemarkOrSourceBatchNo(t *testing.T) {
|
||||
processor := NewProcessor()
|
||||
info := processor.BuildBatchInfo(context.Background(), batchimport.SubmitRequest{
|
||||
BizParams: &model.TSimCardUnsubExcelSubmitParam{},
|
||||
}, nil, nil, nil, 0)
|
||||
|
||||
if info.Get("remark").String() != "" {
|
||||
t.Fatalf("excel batch info should not include remark")
|
||||
}
|
||||
if info.Get("sourceBatchNo").String() != "" {
|
||||
t.Fatalf("excel batch info should not include sourceBatchNo")
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildBatchInfoInputKeepsRemark(t *testing.T) {
|
||||
processor := NewProcessor()
|
||||
info := processor.BuildBatchInfo(context.Background(), batchimport.SubmitRequest{
|
||||
BizParams: &model.TSimCardUnsubInputSubmitParam{Remark: " note "},
|
||||
}, nil, nil, nil, 0)
|
||||
|
||||
if got := info.Get("remark").String(); got != "note" {
|
||||
t.Fatalf("unexpected remark: got %q", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user