Added more tests for empty fields in ees

This commit is contained in:
Trial97
2020-10-07 12:45:28 +03:00
committed by Dan Christian Bogos
parent 45204cec17
commit 4e80f5e703
7 changed files with 142 additions and 38 deletions

View File

@@ -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)
}
}
}