From 53c5bca394449fdbf520ebe5a32fbe6821f21a4d Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Fri, 12 Nov 2021 17:48:03 +0200 Subject: [PATCH] Fix integration tests --- analyzers/analyzers_it_test.go | 5 ++- apier/v1/attributes_it_test.go | 26 +++++++++++---- apier/v1/cache_replication_it_test.go | 4 ++- apier/v1/chargers_it_test.go | 22 ++++++++++--- config/config_it_test.go | 17 ++++++++++ dispatchers/attributes_it_test.go | 6 ++-- engine/routes_test.go | 2 +- general_tests/all_cfg_sect_rld_it_test.go | 10 +++--- .../attributes_filters_index_it_test.go | 4 ++- general_tests/attributes_it_test.go | 32 ++++++++++++++----- general_tests/filters_it_test.go | 15 ++++++--- registrarc/registrarcrpc_it_test.go | 9 +++--- 12 files changed, 113 insertions(+), 39 deletions(-) diff --git a/analyzers/analyzers_it_test.go b/analyzers/analyzers_it_test.go index d450c4eea..d98b89b55 100644 --- a/analyzers/analyzers_it_test.go +++ b/analyzers/analyzers_it_test.go @@ -192,7 +192,10 @@ func testAnalyzerSChargerSv1ProcessEvent(t *testing.T) { "RunID": "*raw", "Subject": "Something_inter", }, - APIOpts: map[string]interface{}{"*subsys": "*chargers"}, + APIOpts: map[string]interface{}{ + "*subsys": "*chargers", + utils.OptsAttributesProfileIDs: []string{"*constant:*req.RequestType:*none"}, + }, }, }, } diff --git a/apier/v1/attributes_it_test.go b/apier/v1/attributes_it_test.go index 2e3db8f6f..ac38d64fc 100644 --- a/apier/v1/attributes_it_test.go +++ b/apier/v1/attributes_it_test.go @@ -378,7 +378,9 @@ func testAttributeSProcessEvent(t *testing.T) { utils.Subject: "1001", utils.Destination: "+491511231234", }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: utils.MetaSessionS, + }, }, } var rplyEv engine.AttrSProcessEventReply @@ -505,7 +507,9 @@ func testAttributeSProcessEventWithNoneSubstitute(t *testing.T) { utils.AccountField: "1001", utils.Destination: "+491511231234", }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: utils.MetaSessionS, + }, }, } @@ -574,7 +578,9 @@ func testAttributeSProcessEventWithNoneSubstitute2(t *testing.T) { utils.AccountField: "1001", utils.Destination: "+491511231234", }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: utils.MetaSessionS, + }, }, } eRply2 := &engine.AttrSProcessEventReply{ @@ -588,7 +594,9 @@ func testAttributeSProcessEventWithNoneSubstitute2(t *testing.T) { utils.AccountField: "1001", utils.Destination: "+491511231234", }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: utils.MetaSessionS, + }, }, } var rplyEv engine.AttrSProcessEventReply @@ -657,7 +665,9 @@ func testAttributeSProcessEventWithNoneSubstitute3(t *testing.T) { utils.Subject: "1001", utils.Destination: "+491511231234", }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: utils.MetaSessionS, + }, }, } var rplyEv engine.AttrSProcessEventReply @@ -703,7 +713,7 @@ func testAttributeSProcessEventWithHeader(t *testing.T) { "Field1": "Value1", }, APIOpts: map[string]interface{}{ - utils.OptsAttributesProcessRuns: 1, + utils.OptsAttributesProcessRuns: 1., utils.OptsContext: utils.MetaSessionS, }, } @@ -718,7 +728,8 @@ func testAttributeSProcessEventWithHeader(t *testing.T) { "Field2": "Value1", }, APIOpts: map[string]interface{}{ - utils.OptsAttributesProcessRuns: 1, + utils.OptsAttributesProcessRuns: 1., + utils.OptsContext: utils.MetaSessionS, }, }, } @@ -1044,6 +1055,7 @@ func testAttributeSProcessEventWithSearchAndReplace(t *testing.T) { }, APIOpts: map[string]interface{}{ utils.OptsAttributesProcessRuns: 1, + utils.OptsContext: utils.MetaSessionS, }, }, } diff --git a/apier/v1/cache_replication_it_test.go b/apier/v1/cache_replication_it_test.go index 6d4fb15fa..780c637c7 100644 --- a/apier/v1/cache_replication_it_test.go +++ b/apier/v1/cache_replication_it_test.go @@ -144,7 +144,9 @@ func testCacheSReplicateProcessAttributes(t *testing.T) { utils.AccountField: "1001", "OfficeGroup": "Marketing", }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: utils.MetaSessionS, + }, }, } var rplyEv engine.AttrSProcessEventReply diff --git a/apier/v1/chargers_it_test.go b/apier/v1/chargers_it_test.go index 63697949e..81e07e7d5 100644 --- a/apier/v1/chargers_it_test.go +++ b/apier/v1/chargers_it_test.go @@ -330,7 +330,11 @@ func testChargerSProcessEvent(t *testing.T) { "Password": "CGRateS.org", "RunID": utils.MetaDefault, }, - APIOpts: map[string]interface{}{utils.OptsContext: "simpleauth", utils.Subsys: utils.MetaChargers}, + APIOpts: map[string]interface{}{ + utils.OptsContext: "simpleauth", + utils.Subsys: utils.MetaChargers, + utils.OptsAttributesProfileIDs: []string{"ATTR_1001_SIMPLEAUTH"}, + }, }, }, } @@ -359,7 +363,11 @@ func testChargerSProcessEvent(t *testing.T) { utils.Category: "call", utils.RunID: utils.MetaDefault, }, - APIOpts: map[string]interface{}{utils.OptsContext: "simpleauth", utils.Subsys: utils.MetaChargers}, + APIOpts: map[string]interface{}{ + utils.OptsContext: "simpleauth", + utils.Subsys: utils.MetaChargers, + utils.OptsAttributesProfileIDs: []string{"*constant:*req.RequestType:*rated;*constant:*req.Category:call"}, + }, }, }, } @@ -533,7 +541,10 @@ func testChargerSProcessWithNotFoundAttribute(t *testing.T) { "CustomField": "WithoutAttributes", "RunID": "CustomRun", }, - APIOpts: map[string]interface{}{utils.Subsys: utils.MetaChargers}, + APIOpts: map[string]interface{}{ + utils.Subsys: utils.MetaChargers, + utils.OptsAttributesProfileIDs: nil, + }, }, }, } @@ -597,7 +608,8 @@ func testChargerSProccessEventWithProcceSRunS(t *testing.T) { }, APIOpts: map[string]interface{}{ utils.Subsys: utils.MetaChargers, - utils.OptsAttributesProcessRuns: 1., + utils.OptsAttributesProfileIDs: []string{"*constant:*req.Account:1002", "*constant:*req.Account:1003"}, + utils.OptsAttributesProcessRuns: 1, }, }, }, @@ -608,7 +620,7 @@ func testChargerSProccessEventWithProcceSRunS(t *testing.T) { Event: map[string]interface{}{ utils.AccountField: "1010", }, - APIOpts: map[string]interface{}{utils.OptsAttributesProcessRuns: 1.}, + APIOpts: map[string]interface{}{utils.OptsAttributesProcessRuns: 1}, } var result2 []*engine.ChrgSProcessEventReply if err := chargerRPC.Call(utils.ChargerSv1ProcessEvent, cgrEv, &result2); err != nil { diff --git a/config/config_it_test.go b/config/config_it_test.go index 58258d287..d286e2ab3 100644 --- a/config/config_it_test.go +++ b/config/config_it_test.go @@ -235,6 +235,9 @@ func testCGRConfigReloadThresholdS(t *testing.T) { PrefixIndexedFields: &[]string{}, SuffixIndexedFields: &[]string{}, IndexedSelects: true, + Opts: &ThresholdsOpts{ + ProfileIDs: []string{}, + }, } if !reflect.DeepEqual(expAttr, cfg.ThresholdSCfg()) { t.Errorf("Expected %s , received: %s ", utils.ToJSON(expAttr), utils.ToJSON(cfg.ThresholdSCfg())) @@ -262,6 +265,9 @@ func testCGRConfigReloadStatS(t *testing.T) { SuffixIndexedFields: &[]string{}, IndexedSelects: true, ThresholdSConns: []string{utils.MetaLocalHost}, + Opts: &StatsOpts{ + ProfileIDs: []string{}, + }, } if !reflect.DeepEqual(expAttr, cfg.StatSCfg()) { t.Errorf("Expected %s , received: %s ", utils.ToJSON(expAttr), utils.ToJSON(cfg.StatSCfg())) @@ -289,6 +295,11 @@ func testCGRConfigReloadResourceS(t *testing.T) { SuffixIndexedFields: &[]string{}, IndexedSelects: true, ThresholdSConns: []string{utils.MetaLocalHost}, + Opts: &ResourcesOpts{ + UsageID: utils.EmptyString, + UsageTTL: 72 * time.Hour, + Units: 1, + }, } if !reflect.DeepEqual(expAttr, cfg.ResourceSCfg()) { t.Errorf("Expected %s , received: %s ", utils.ToJSON(expAttr), utils.ToJSON(cfg.ResourceSCfg())) @@ -320,6 +331,12 @@ func testCGRConfigReloadSupplierS(t *testing.T) { RALsConns: []string{}, IndexedSelects: true, DefaultRatio: 1, + Opts: &RoutesOpts{ + Context: utils.MetaRoutes, + IgnoreErrors: false, + MaxCost: utils.EmptyString, + ProfileCount: 1, + }, } if !reflect.DeepEqual(expAttr, cfg.RouteSCfg()) { t.Errorf("Expected %s , received: %s ", utils.ToJSON(expAttr), utils.ToJSON(cfg.RouteSCfg())) diff --git a/dispatchers/attributes_it_test.go b/dispatchers/attributes_it_test.go index e9c21aa9b..00be46838 100644 --- a/dispatchers/attributes_it_test.go +++ b/dispatchers/attributes_it_test.go @@ -255,7 +255,8 @@ func testDspAttrGetAttrFailover(t *testing.T) { "Password": "CGRateS.org", }, APIOpts: map[string]interface{}{ - utils.OptsAPIKey: "attr12345", + utils.OptsAPIKey: "attr12345", + utils.OptsContext: "simpleauth", }, }, } @@ -599,7 +600,8 @@ func testDspAttrGetAttrInternal(t *testing.T) { "Password": "CGRateS.com", }, APIOpts: map[string]interface{}{ - utils.OptsAPIKey: "attr12345", + utils.OptsAPIKey: "attr12345", + utils.OptsContext: "simpleauth", }, }, } diff --git a/engine/routes_test.go b/engine/routes_test.go index 7d4d9a5e8..ea6a62d0c 100644 --- a/engine/routes_test.go +++ b/engine/routes_test.go @@ -534,7 +534,7 @@ func TestRoutesSortedForEventWithLimitAndOffset(t *testing.T) { }, }} testRoutesArgs[1].APIOpts[utils.OptsRoutesLimit] = 1 - testRoutesArgs[1].APIOpts[utils.OptsRoutesLimit] = 1 + testRoutesArgs[1].APIOpts[utils.OptsRoutesOffset] = 1 sprf, err := routeService.sortedRoutesForEvent("cgrates.org", testRoutesArgs[1]) if err != nil { t.Fatal(err) diff --git a/general_tests/all_cfg_sect_rld_it_test.go b/general_tests/all_cfg_sect_rld_it_test.go index ca81e5688..d75838db7 100644 --- a/general_tests/all_cfg_sect_rld_it_test.go +++ b/general_tests/all_cfg_sect_rld_it_test.go @@ -902,7 +902,7 @@ func testSectConfigSReloadAttributes(t *testing.T) { } else if reply != utils.OK { t.Errorf("Expected OK received: %+v", reply) } - cfgStr := "{\"attributes\":{\"any_context\":true,\"apiers_conns\":[\"*internal\"],\"enabled\":true,\"indexed_selects\":true,\"nested_fields\":true,\"prefix_indexed_fields\":[\"prefix_indexed_fields\"],\"process_runs\":1,\"profile_runs\":0,\"resources_conns\":[\"*internal\"],\"stats_conns\":[\"*internal\"],\"string_indexed_fields\":[\"string_indexed_fields\"],\"suffix_indexed_fields\":[\"suffix_indexed_fields\"]}}" + cfgStr := "{\"attributes\":{\"any_context\":true,\"apiers_conns\":[\"*internal\"],\"enabled\":true,\"indexed_selects\":true,\"nested_fields\":true,\"opts\":{\"*processRuns\":1,\"*profileIDs\":[],\"*profileIgnoreFilters\":false,\"*profileRuns\":0},\"prefix_indexed_fields\":[\"prefix_indexed_fields\"],\"resources_conns\":[\"*internal\"],\"stats_conns\":[\"*internal\"],\"string_indexed_fields\":[\"string_indexed_fields\"],\"suffix_indexed_fields\":[\"suffix_indexed_fields\"]}}" var rpl string if err := testSectRPC.Call(utils.ConfigSv1GetConfigAsJSON, &config.SectionWithAPIOpts{ @@ -981,7 +981,7 @@ func testSectConfigSReloadResources(t *testing.T) { } else if reply != utils.OK { t.Errorf("Expected OK received: %+v", reply) } - cfgStr := "{\"resources\":{\"enabled\":true,\"indexed_selects\":true,\"nested_fields\":true,\"prefix_indexed_fields\":[\"prefix_indexed_fields\"],\"store_interval\":\"-1ns\",\"string_indexed_fields\":[\"string_indexed_fields\"],\"suffix_indexed_fields\":[\"suffix_indexed_fields\"],\"thresholds_conns\":[\"*internal\"]}}" + cfgStr := "{\"resources\":{\"enabled\":true,\"indexed_selects\":true,\"nested_fields\":true,\"opts\":{\"*units\":1,\"*usageID\":\"\",\"*usageTTL\":259200000000000},\"prefix_indexed_fields\":[\"prefix_indexed_fields\"],\"store_interval\":\"-1ns\",\"string_indexed_fields\":[\"string_indexed_fields\"],\"suffix_indexed_fields\":[\"suffix_indexed_fields\"],\"thresholds_conns\":[\"*internal\"]}}" var rpl string if err := testSectRPC.Call(utils.ConfigSv1GetConfigAsJSON, &config.SectionWithAPIOpts{ Tenant: "cgrates.org", @@ -1022,7 +1022,7 @@ func testSectConfigSReloadStats(t *testing.T) { } else if reply != utils.OK { t.Errorf("Expected OK received: %+v", reply) } - cfgStr := "{\"stats\":{\"enabled\":true,\"indexed_selects\":true,\"nested_fields\":true,\"prefix_indexed_fields\":[\"prefix_indexed_fields\"],\"store_interval\":\"-1ns\",\"store_uncompressed_limit\":1,\"string_indexed_fields\":[\"string_indexed_fields\"],\"suffix_indexed_fields\":[\"suffix_indexed_fields\"],\"thresholds_conns\":[\"*internal\"]}}" + cfgStr := "{\"stats\":{\"enabled\":true,\"indexed_selects\":true,\"nested_fields\":true,\"opts\":{\"*profileIDs\":[],\"*profileIgnoreFilters\":false},\"prefix_indexed_fields\":[\"prefix_indexed_fields\"],\"store_interval\":\"-1ns\",\"store_uncompressed_limit\":1,\"string_indexed_fields\":[\"string_indexed_fields\"],\"suffix_indexed_fields\":[\"suffix_indexed_fields\"],\"thresholds_conns\":[\"*internal\"]}}" var rpl string if err := testSectRPC.Call(utils.ConfigSv1GetConfigAsJSON, &config.SectionWithAPIOpts{ Tenant: "cgrates.org", @@ -1052,7 +1052,7 @@ func testSectConfigSReloadThresholds(t *testing.T) { } else if reply != utils.OK { t.Errorf("Expected OK received: %+v", reply) } - cfgStr := "{\"thresholds\":{\"enabled\":true,\"indexed_selects\":true,\"nested_fields\":true,\"prefix_indexed_fields\":[\"prefix_indexed_fields\"],\"store_interval\":\"-1ns\",\"string_indexed_fields\":[\"string_indexed_fields\"],\"suffix_indexed_fields\":[\"suffix_indexed_fields\"]}}" + cfgStr := "{\"thresholds\":{\"enabled\":true,\"indexed_selects\":true,\"nested_fields\":true,\"opts\":{\"*profileIDs\":[],\"*profileIgnoreFilters\":false},\"prefix_indexed_fields\":[\"prefix_indexed_fields\"],\"store_interval\":\"-1ns\",\"string_indexed_fields\":[\"string_indexed_fields\"],\"suffix_indexed_fields\":[\"suffix_indexed_fields\"]}}" var rpl string if err := testSectRPC.Call(utils.ConfigSv1GetConfigAsJSON, &config.SectionWithAPIOpts{ Tenant: "cgrates.org", @@ -1095,7 +1095,7 @@ func testSectConfigSReloadRoutes(t *testing.T) { } else if reply != utils.OK { t.Errorf("Expected OK received: %+v", reply) } - cfgStr := "{\"routes\":{\"attributes_conns\":[\"*localhost\"],\"default_ratio\":1,\"enabled\":true,\"indexed_selects\":true,\"nested_fields\":true,\"prefix_indexed_fields\":[\"prefix_indexed_fields\"],\"rals_conns\":[\"*localhost\"],\"resources_conns\":[\"*localhost\"],\"stats_conns\":[\"*localhost\"],\"string_indexed_fields\":[\"string_indexed_fields\"],\"suffix_indexed_fields\":[\"suffix_indexed_fields\"]}}" + cfgStr := "{\"routes\":{\"attributes_conns\":[\"*localhost\"],\"default_ratio\":1,\"enabled\":true,\"indexed_selects\":true,\"nested_fields\":true,\"opts\":{\"*context\":\"*routes\",\"*ignoreErrors\":false,\"*maxCost\":\"\",\"*profileCount\":1},\"prefix_indexed_fields\":[\"prefix_indexed_fields\"],\"rals_conns\":[\"*localhost\"],\"resources_conns\":[\"*localhost\"],\"stats_conns\":[\"*localhost\"],\"string_indexed_fields\":[\"string_indexed_fields\"],\"suffix_indexed_fields\":[\"suffix_indexed_fields\"]}}" var rpl string if err := testSectRPC.Call(utils.ConfigSv1GetConfigAsJSON, &config.SectionWithAPIOpts{ Tenant: "cgrates.org", diff --git a/general_tests/attributes_filters_index_it_test.go b/general_tests/attributes_filters_index_it_test.go index 24a85ceb6..b8aecfde6 100644 --- a/general_tests/attributes_filters_index_it_test.go +++ b/general_tests/attributes_filters_index_it_test.go @@ -229,7 +229,9 @@ func testAttributeSetFltr2(t *testing.T) { "Subject": "4444", "FL1": "Al1", }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: utils.MetaSessionS, + }, }, } var rplyEv engine.AttrSProcessEventReply diff --git a/general_tests/attributes_it_test.go b/general_tests/attributes_it_test.go index df4527b61..e1833b6de 100644 --- a/general_tests/attributes_it_test.go +++ b/general_tests/attributes_it_test.go @@ -149,7 +149,9 @@ func testAttributeSProcessEvent(t *testing.T) { utils.Category: utils.MetaVoice, utils.ToR: utils.MetaVoice, }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: utils.MetaSessionS, + }, }, } sort.Strings(eRply.AlteredFields) @@ -230,7 +232,9 @@ func testAttributeSProcessEventWithAccount(t *testing.T) { "EventName": "AddAccountInfo", "Balance": "10", }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: utils.MetaSessionS, + }, }, } sort.Strings(eRply.AlteredFields) @@ -439,7 +443,9 @@ func testAttributeSProcessEventWithStat(t *testing.T) { "EventName": "AddStatEvent", "AcdMetric": "11000000000", }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: utils.MetaSessionS, + }, }, } sort.Strings(eRply.AlteredFields) @@ -520,7 +526,9 @@ func testAttributeSProcessEventWithStatFull(t *testing.T) { "EventName": "AddFullStats", "AllMetrics": "{\"*acd\":11000000000,\"*asr\":100,\"*tcd\":22000000000}", }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: utils.MetaSessionS, + }, }, } sort.Strings(eRply.AlteredFields) @@ -660,7 +668,9 @@ func testAttributeSProcessEventWithResource(t *testing.T) { "EventName": "AddResourceUsages", "ResourceTotalUsages": "5", }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: utils.MetaSessionS, + }, }, } sort.Strings(eRply.AlteredFields) @@ -834,7 +844,9 @@ func testAttributeSProcessEventWithLibPhoneNumber(t *testing.T) { "Destination": "+447779330921", "DestinationCarrier": "Orange", }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: utils.MetaSessionS, + }, }, } sort.Strings(eRply.AlteredFields) @@ -935,7 +947,9 @@ func testAttributeSProcessEventWithLibPhoneNumberComposed(t *testing.T) { "Destination": "+447779330921", "DestinationCarrier": "Orange;44", }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: utils.MetaSessionS, + }, }, } sort.Strings(eRply.AlteredFields) @@ -1018,7 +1032,9 @@ func testAttributeSProcessEventWithLibPhoneNumberFull(t *testing.T) { "Destination": "+447779330921", "DestinationDetails": "{\"Carrier\":\"Orange\",\"CountryCode\":44,\"CountryCodeSource\":1,\"Extension\":\"\",\"GeoLocation\":\"\",\"ItalianLeadingZero\":false,\"LengthOfNationalDestinationCode\":0,\"NationalNumber\":7779330921,\"NumberOfLeadingZeros\":1,\"NumberType\":1,\"PreferredDomesticCarrierCode\":\"\",\"RawInput\":\"+447779330921\",\"Region\":\"GB\"}", }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: utils.MetaSessionS, + }, }, } sort.Strings(eRply.AlteredFields) diff --git a/general_tests/filters_it_test.go b/general_tests/filters_it_test.go index 52cbfed65..cb47c06e1 100644 --- a/general_tests/filters_it_test.go +++ b/general_tests/filters_it_test.go @@ -938,7 +938,8 @@ func testV1FltrChargerSuffix(t *testing.T) { utils.Destination: "999", }, APIOpts: map[string]interface{}{ - utils.Subsys: utils.MetaChargers, + utils.Subsys: utils.MetaChargers, + utils.OptsAttributesProfileIDs: []string{"*constant:*req.Subject:intraState"}, }, }, }, @@ -975,7 +976,8 @@ func testV1FltrChargerSuffix(t *testing.T) { utils.Destination: "999", }, APIOpts: map[string]interface{}{ - utils.Subsys: utils.MetaChargers, + utils.Subsys: utils.MetaChargers, + utils.OptsAttributesProfileIDs: []string{"*constant:*req.Subject:interState"}, }, }, }, @@ -1034,7 +1036,9 @@ func testV1FltrAttributesPrefix(t *testing.T) { "CustomField2": "+2007", utils.Destination: "+1207", }, - APIOpts: map[string]interface{}{}, + APIOpts: map[string]interface{}{ + utils.OptsContext: "prefix", + }, }, } cgrEv := &utils.CGREvent{ @@ -1139,7 +1143,10 @@ func testV1FltrPopulateTimings(t *testing.T) { Event: map[string]interface{}{ utils.AnswerTime: "2021-04-29T10:45:00Z", }, - APIOpts: make(map[string]interface{}), + APIOpts: map[string]interface{}{ + utils.OptsAttributesProfileIDs: []string{"FltrTest"}, + utils.OptsContext: utils.MetaAny, + }, }, } diff --git a/registrarc/registrarcrpc_it_test.go b/registrarc/registrarcrpc_it_test.go index 92eb4f545..3df3b3f9f 100644 --- a/registrarc/registrarcrpc_it_test.go +++ b/registrarc/registrarcrpc_it_test.go @@ -176,8 +176,9 @@ func testRPCChargerSWithAttr(t *testing.T) { "RunID": "raw", }, APIOpts: map[string]interface{}{ - "*processRuns": 1., - "*subsys": "*chargers", + utils.OptsAttributesProcessRuns: 1, + utils.OptsAttributesProfileIDs: []string{"*constant:*req.RequestType:*none"}, + "*subsys": "*chargers", }, }, }, { @@ -192,8 +193,8 @@ func testRPCChargerSWithAttr(t *testing.T) { "Subject": "SUPPLIER1", }, APIOpts: map[string]interface{}{ - "*processRuns": 1., - "*subsys": "*chargers", + utils.OptsAttributesProcessRuns: 1, + "*subsys": "*chargers", }, }, },