From caebee4eab90bf09d0106bd192ff171b72aff304 Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Fri, 28 Feb 2025 16:09:38 +0200 Subject: [PATCH] Fix failing elastic exporter test does not expect OriginID field to be present anymore if exporting without defining any templates. Not defining them means only the Event will be exported as is, while OriginID is part of APIOpts. --- ees/elastic_it_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ees/elastic_it_test.go b/ees/elastic_it_test.go index 55afbe963..34afe3429 100644 --- a/ees/elastic_it_test.go +++ b/ees/elastic_it_test.go @@ -98,7 +98,7 @@ func exportElsEvent(t *testing.T, client *birpc.Client, exporterSuffix string, i EeIDs: []string{fmt.Sprintf("els_%s", exporterSuffix)}, CGREvent: &utils.CGREvent{ Tenant: "cgrates.org", - Event: map[string]interface{}{ + Event: map[string]any{ utils.AccountField: "1001", utils.ToR: utils.MetaData, utils.RequestType: utils.MetaPostpaid, @@ -158,8 +158,12 @@ func verifyElsExports(t *testing.T, client *elasticsearch.TypedClient, exporterT expSource[utils.Usage] = float64(wantUsage) } else { expSource[utils.Usage] = strconv.Itoa(wantUsage) + + // OriginID can only be passed via templates, as it's part of + // APIOpts. If none are configured, only the Event would be + // exported. + expSource[utils.OriginID] = wantOriginID } - expSource[utils.OriginID] = wantOriginID wantDocID := wantOriginID + ":*default" if *hit.Id_ != wantDocID { t.Errorf("hit.Id_ = %s, want %s", *hit.Id_, wantDocID)