mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Started tests in ers
This commit is contained in:
committed by
Dan Christian Bogos
parent
95d98e70ad
commit
1dbab4542e
@@ -104,3 +104,66 @@ func TestERsListenAndServeErr(t *testing.T) {
|
||||
t.Fatalf("\nExpecting <%+v>,\n Received <%+v>", "unsupported reader type: <>", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestERsProcessEventErr(t *testing.T) {
|
||||
cfg := config.NewDefaultCGRConfig()
|
||||
cfg.ERsCfg().Readers = []*config.EventReaderCfg{
|
||||
{
|
||||
ID: "",
|
||||
Type: "",
|
||||
RowLength: 0,
|
||||
FieldSep: "",
|
||||
HeaderDefineChar: "",
|
||||
RunDelay: 0,
|
||||
ConcurrentReqs: 0,
|
||||
SourcePath: "",
|
||||
ProcessedPath: "",
|
||||
Opts: nil,
|
||||
XMLRootPath: nil,
|
||||
Tenant: nil,
|
||||
Timezone: "",
|
||||
Filters: nil,
|
||||
Flags: nil,
|
||||
FailedCallsPrefix: "",
|
||||
PartialRecordCache: 0,
|
||||
PartialCacheExpiryAction: "",
|
||||
Fields: nil,
|
||||
CacheDumpFields: nil,
|
||||
},
|
||||
}
|
||||
fltrS := &engine.FilterS{}
|
||||
srv := NewERService(cfg, fltrS, nil)
|
||||
rdrCfg := &config.EventReaderCfg{
|
||||
ID: "",
|
||||
Type: "",
|
||||
RowLength: 0,
|
||||
FieldSep: "",
|
||||
HeaderDefineChar: "",
|
||||
RunDelay: 0,
|
||||
ConcurrentReqs: 0,
|
||||
SourcePath: "",
|
||||
ProcessedPath: "",
|
||||
Opts: nil,
|
||||
XMLRootPath: nil,
|
||||
Tenant: nil,
|
||||
Timezone: "",
|
||||
Filters: nil,
|
||||
Flags: nil,
|
||||
FailedCallsPrefix: "",
|
||||
PartialRecordCache: 0,
|
||||
PartialCacheExpiryAction: "",
|
||||
Fields: nil,
|
||||
CacheDumpFields: nil,
|
||||
}
|
||||
cgrEvent := &utils.CGREvent{
|
||||
Tenant: "",
|
||||
ID: "",
|
||||
Time: nil,
|
||||
Event: nil,
|
||||
Opts: nil,
|
||||
}
|
||||
err := srv.processEvent(cgrEvent, rdrCfg)
|
||||
if err == nil || err.Error() != "unsupported reqType: <>" {
|
||||
t.Fatalf("\nExpecting <%+v>,\n Received <%+v>", "unsupported reqType: <>", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user