mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Added more tests for empty fields in ees
This commit is contained in:
committed by
Dan Christian Bogos
parent
45204cec17
commit
4e80f5e703
@@ -200,6 +200,28 @@ func testHTTPExportEvent(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
eventSMSNoFields := &utils.CGREventWithOpts{
|
||||
CGREvent: &utils.CGREvent{
|
||||
Tenant: "cgrates.org",
|
||||
ID: "SMSEvent",
|
||||
Time: utils.TimePointer(time.Now()),
|
||||
Event: map[string]interface{}{
|
||||
utils.CGRID: utils.Sha1("sms2", time.Unix(1383813745, 0).UTC().String()),
|
||||
utils.ToR: utils.SMS,
|
||||
utils.OriginID: "sms2",
|
||||
utils.RequestType: utils.META_RATED,
|
||||
utils.Tenant: "cgrates.org",
|
||||
utils.Category: "call",
|
||||
utils.Account: "1001",
|
||||
utils.Subject: "1001",
|
||||
utils.Destination: "1002",
|
||||
utils.RunID: utils.MetaDefault,
|
||||
"ExporterUsed": "HTTPPostExporterWithNoFields",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
var reply map[string]utils.MapStorage
|
||||
if err := httpPostRpc.Call(utils.EventExporterSv1ProcessEvent, eventVoice, &reply); err != nil {
|
||||
t.Error(err)
|
||||
@@ -255,4 +277,14 @@ func testHTTPExportEvent(t *testing.T) {
|
||||
t.Errorf("Expected %+v, received: %+v", strVal, rcv)
|
||||
}
|
||||
}
|
||||
if err := httpPostRpc.Call(utils.EventExporterSv1ProcessEvent, eventSMSNoFields, &reply); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
// verify HTTPValues for eventSMS
|
||||
for key, strVal := range eventSMSNoFields.Event {
|
||||
if rcv := httpValues.Get(key); rcv != strVal {
|
||||
t.Errorf("Expected %+v, received: %+v", strVal, rcv)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user