mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Updated basic test for dynamic filter values
This commit is contained in:
committed by
Dan Christian Bogos
parent
29ad0f480f
commit
e949b3e37f
@@ -76,28 +76,28 @@ func TestAgReqAsNavigableMap(t *testing.T) {
|
||||
|
||||
&config.FCTemplate{Tag: "RequestedUsageVoice",
|
||||
FieldId: "RequestedUsage", Type: utils.META_COMPOSED,
|
||||
Filters: []string{"*string:*cgreq.ToR:*voice"},
|
||||
Filters: []string{"*string:~*cgreq.ToR:*voice"},
|
||||
Value: config.NewRSRParsersMustCompile(
|
||||
"~*cgreq.Usage{*duration_seconds}", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "RequestedUsageData",
|
||||
FieldId: "RequestedUsage", Type: utils.META_COMPOSED,
|
||||
Filters: []string{"*string:*cgreq.ToR:*data"},
|
||||
Filters: []string{"*string:~*cgreq.ToR:*data"},
|
||||
Value: config.NewRSRParsersMustCompile(
|
||||
"~*cgreq.Usage{*duration_nanoseconds}", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "RequestedUsageSMS",
|
||||
FieldId: "RequestedUsage", Type: utils.META_COMPOSED,
|
||||
Filters: []string{"*string:*cgreq.ToR:*sms"},
|
||||
Filters: []string{"*string:~*cgreq.ToR:*sms"},
|
||||
Value: config.NewRSRParsersMustCompile(
|
||||
"~*cgreq.Usage{*duration_nanoseconds}", true, utils.INFIELD_SEP)},
|
||||
|
||||
&config.FCTemplate{Tag: "AttrPaypalAccount",
|
||||
FieldId: "PaypalAccount", Type: utils.META_COMPOSED,
|
||||
Filters: []string{"*string:*cgrep.Error:"},
|
||||
Filters: []string{"*string:~*cgrep.Error:"},
|
||||
Value: config.NewRSRParsersMustCompile(
|
||||
"~*cgrep.Attributes.PaypalAccount", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "MaxUsage",
|
||||
FieldId: "MaxUsage", Type: utils.META_COMPOSED,
|
||||
Filters: []string{"*string:*cgrep.Error:"},
|
||||
Filters: []string{"*string:~*cgrep.Error:"},
|
||||
Value: config.NewRSRParsersMustCompile(
|
||||
"~*cgrep.MaxUsage{*duration_seconds}", true, utils.INFIELD_SEP)},
|
||||
&config.FCTemplate{Tag: "Error",
|
||||
|
||||
@@ -280,7 +280,7 @@ func TestXMLRPProcessWithNewFilters(t *testing.T) {
|
||||
DataUsageMultiplyFactor: 1024,
|
||||
CDRPath: utils.HierarchyPath([]string{"broadWorksCDR", "cdrData"}),
|
||||
CdrSourceId: "XMLWithFilters",
|
||||
Filters: []string{"*string:broadWorksCDR.cdrData.headerModule.type:Normal"},
|
||||
Filters: []string{"*string:~broadWorksCDR.cdrData.headerModule.type:Normal"},
|
||||
ContentFields: []*config.FCTemplate{
|
||||
{Tag: "TOR", Type: utils.META_COMPOSED, FieldId: utils.ToR,
|
||||
Value: config.NewRSRParsersMustCompile("*voice", true, utils.INFIELD_SEP), Mandatory: true},
|
||||
|
||||
@@ -132,7 +132,7 @@ var (
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "AttributeIDMatch",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*gte:DistinctMatch:20"},
|
||||
FilterIDs: []string{"*gte:~DistinctMatch:20"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
ExpiryTime: cloneExpTimeAttributes,
|
||||
@@ -172,17 +172,17 @@ func TestAttributeAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaString,
|
||||
FieldName: "Attribute",
|
||||
FieldName: "~Attribute",
|
||||
Values: []string{"AttributeProfile1"},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: "UsageInterval",
|
||||
FieldName: "~UsageInterval",
|
||||
Values: []string{(1 * time.Second).String()},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: utils.Weight,
|
||||
FieldName: utils.DynamicDataPrefix + utils.Weight,
|
||||
Values: []string{"9.0"},
|
||||
},
|
||||
},
|
||||
@@ -194,7 +194,7 @@ func TestAttributeAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaString,
|
||||
FieldName: "Attribute",
|
||||
FieldName: "~Attribute",
|
||||
Values: []string{"AttributeProfile2"},
|
||||
},
|
||||
},
|
||||
@@ -206,7 +206,7 @@ func TestAttributeAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaPrefix,
|
||||
FieldName: "Attribute",
|
||||
FieldName: "~Attribute",
|
||||
Values: []string{"AttributeProfilePrefix"},
|
||||
},
|
||||
},
|
||||
@@ -218,7 +218,7 @@ func TestAttributeAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: utils.Weight,
|
||||
FieldName: utils.DynamicDataPrefix + utils.Weight,
|
||||
Values: []string{"200.00"},
|
||||
},
|
||||
},
|
||||
@@ -403,7 +403,7 @@ func TestAttributeIndexer(t *testing.T) {
|
||||
Tenant: "cgrates.org",
|
||||
ID: "AttrPrf",
|
||||
Contexts: []string{utils.META_ANY},
|
||||
FilterIDs: []string{"*string:Account:1007"},
|
||||
FilterIDs: []string{"*string:~Account:1007"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
ExpiryTime: cloneExpTimeAttributes,
|
||||
@@ -420,7 +420,7 @@ func TestAttributeIndexer(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
eIdxes := map[string]utils.StringMap{
|
||||
"*string:Account:1007": {
|
||||
"*string:~Account:1007": {
|
||||
"AttrPrf": true,
|
||||
},
|
||||
}
|
||||
@@ -470,7 +470,7 @@ func TestAttributeProcessWithMultipleRuns1(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_1",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:InitialField:InitialValue"},
|
||||
FilterIDs: []string{"*string:~InitialField:InitialValue"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -486,7 +486,7 @@ func TestAttributeProcessWithMultipleRuns1(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_2",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:Field1:Value1"},
|
||||
FilterIDs: []string{"*string:~Field1:Value1"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -502,7 +502,7 @@ func TestAttributeProcessWithMultipleRuns1(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_3",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:Field2:Value2"},
|
||||
FilterIDs: []string{"*string:~Field2:Value2"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -578,7 +578,7 @@ func TestAttributeProcessWithMultipleRuns2(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_1",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:InitialField:InitialValue"},
|
||||
FilterIDs: []string{"*string:~InitialField:InitialValue"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -594,7 +594,7 @@ func TestAttributeProcessWithMultipleRuns2(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_2",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:Field1:Value1"},
|
||||
FilterIDs: []string{"*string:~Field1:Value1"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -610,7 +610,7 @@ func TestAttributeProcessWithMultipleRuns2(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_3",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:NotFound:NotFound"},
|
||||
FilterIDs: []string{"*string:~NotFound:NotFound"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -685,7 +685,7 @@ func TestAttributeProcessWithMultipleRuns3(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_1",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:InitialField:InitialValue"},
|
||||
FilterIDs: []string{"*string:~InitialField:InitialValue"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -701,7 +701,7 @@ func TestAttributeProcessWithMultipleRuns3(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_2",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:Field1:Value1"},
|
||||
FilterIDs: []string{"*string:~Field1:Value1"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -717,7 +717,7 @@ func TestAttributeProcessWithMultipleRuns3(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_3",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:Field2:Value2"},
|
||||
FilterIDs: []string{"*string:~Field2:Value2"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -792,7 +792,7 @@ func TestAttributeProcessWithMultipleRuns4(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_1",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:InitialField:InitialValue"},
|
||||
FilterIDs: []string{"*string:~InitialField:InitialValue"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -808,7 +808,7 @@ func TestAttributeProcessWithMultipleRuns4(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_2",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:Field1:Value1"},
|
||||
FilterIDs: []string{"*string:~Field1:Value1"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -880,7 +880,7 @@ func TestAttributeMultipleProcessWithBlocker(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_1",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:InitialField:InitialValue"},
|
||||
FilterIDs: []string{"*string:~InitialField:InitialValue"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -896,7 +896,7 @@ func TestAttributeMultipleProcessWithBlocker(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_2",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:Field1:Value1"},
|
||||
FilterIDs: []string{"*string:~Field1:Value1"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -913,7 +913,7 @@ func TestAttributeMultipleProcessWithBlocker(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_3",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:Field2:Value2"},
|
||||
FilterIDs: []string{"*string:~Field2:Value2"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -988,7 +988,7 @@ func TestAttributeMultipleProcessWithBlocker2(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_1",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:InitialField:InitialValue"},
|
||||
FilterIDs: []string{"*string:~InitialField:InitialValue"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -1005,7 +1005,7 @@ func TestAttributeMultipleProcessWithBlocker2(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_2",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:Field1:Value1"},
|
||||
FilterIDs: []string{"*string:~Field1:Value1"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -1021,7 +1021,7 @@ func TestAttributeMultipleProcessWithBlocker2(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_3",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:Field2:Value2"},
|
||||
FilterIDs: []string{"*string:~Field2:Value2"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
@@ -1095,7 +1095,7 @@ func TestAttributeProcessSubstitute(t *testing.T) {
|
||||
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
|
||||
ID: "ATTR_1",
|
||||
Contexts: []string{utils.MetaSessionS},
|
||||
FilterIDs: []string{"*string:Field1:Value1"},
|
||||
FilterIDs: []string{"*string:~Field1:Value1"},
|
||||
ActivationInterval: &utils.ActivationInterval{
|
||||
ActivationTime: time.Date(2014, 7, 14, 14, 25, 0, 0, time.UTC),
|
||||
},
|
||||
|
||||
@@ -129,13 +129,13 @@ func TestExportVoiceWithConvert(t *testing.T) {
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"AnswerTime", true, utils.INFIELD_SEP),
|
||||
Layout: "2006-01-02T15:04:05Z07:00"},
|
||||
{Tag: "UsageVoice", Type: "*composed",
|
||||
Filters: []string{"*string:ToR:*voice"},
|
||||
Filters: []string{"*string:~ToR:*voice"},
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"Usage{*duration_seconds}", true, utils.INFIELD_SEP)},
|
||||
{Tag: "UsageData", Type: "*composed",
|
||||
Filters: []string{"*string:ToR:*data"},
|
||||
Filters: []string{"*string:~ToR:*data"},
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"Usage{*duration_nanoseconds}", true, utils.INFIELD_SEP)},
|
||||
{Tag: "UsageSMS", Type: "*composed",
|
||||
Filters: []string{"*string:ToR:*sms"},
|
||||
Filters: []string{"*string:~ToR:*sms"},
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"Usage{*duration_nanoseconds}", true, utils.INFIELD_SEP)},
|
||||
{Tag: "Cost", Type: "*composed",
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"Cost", true, utils.INFIELD_SEP),
|
||||
@@ -207,7 +207,7 @@ func TestExportWithFilter(t *testing.T) {
|
||||
writer := &bytes.Buffer{}
|
||||
cfg, _ := config.NewDefaultCGRConfig()
|
||||
cdreCfg := cfg.CdreProfiles["*default"]
|
||||
cdreCfg.Filters = []string{"*string:Tenant:cgrates.org"}
|
||||
cdreCfg.Filters = []string{"*string:~Tenant:cgrates.org"}
|
||||
cdreCfg.ContentFields = []*config.FCTemplate{
|
||||
{Tag: "ToR", Type: "*composed",
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"ToR", true, utils.INFIELD_SEP)},
|
||||
@@ -227,13 +227,13 @@ func TestExportWithFilter(t *testing.T) {
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"AnswerTime", true, utils.INFIELD_SEP),
|
||||
Layout: "2006-01-02T15:04:05Z07:00"},
|
||||
{Tag: "UsageVoice", Type: "*composed",
|
||||
Filters: []string{"*string:ToR:*voice"},
|
||||
Filters: []string{"*string:~ToR:*voice"},
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"Usage{*duration_seconds}", true, utils.INFIELD_SEP)},
|
||||
{Tag: "UsageData", Type: "*composed",
|
||||
Filters: []string{"*string:ToR:*data"},
|
||||
Filters: []string{"*string:~ToR:*data"},
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"Usage{*duration_nanoseconds}", true, utils.INFIELD_SEP)},
|
||||
{Tag: "UsageSMS", Type: "*composed",
|
||||
Filters: []string{"*string:ToR:*sms"},
|
||||
Filters: []string{"*string:~ToR:*sms"},
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"Usage{*duration_nanoseconds}", true, utils.INFIELD_SEP)},
|
||||
{Tag: "Cost", Type: "*composed",
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"Cost", true, utils.INFIELD_SEP),
|
||||
@@ -304,7 +304,7 @@ func TestExportWithFilter2(t *testing.T) {
|
||||
writer := &bytes.Buffer{}
|
||||
cfg, _ := config.NewDefaultCGRConfig()
|
||||
cdreCfg := cfg.CdreProfiles["*default"]
|
||||
cdreCfg.Filters = []string{"*string:Tenant:cgrates.org", "*lte:Cost:0.5"}
|
||||
cdreCfg.Filters = []string{"*string:~Tenant:cgrates.org", "*lte:~Cost:0.5"}
|
||||
cdreCfg.ContentFields = []*config.FCTemplate{
|
||||
{Tag: "ToR", Type: "*composed",
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"ToR", true, utils.INFIELD_SEP)},
|
||||
@@ -324,13 +324,13 @@ func TestExportWithFilter2(t *testing.T) {
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"AnswerTime", true, utils.INFIELD_SEP),
|
||||
Layout: "2006-01-02T15:04:05Z07:00"},
|
||||
{Tag: "UsageVoice", Type: "*composed",
|
||||
Filters: []string{"*string:ToR:*voice"},
|
||||
Filters: []string{"*string:~ToR:*voice"},
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"Usage{*duration_seconds}", true, utils.INFIELD_SEP)},
|
||||
{Tag: "UsageData", Type: "*composed",
|
||||
Filters: []string{"*string:ToR:*data"},
|
||||
Filters: []string{"*string:~ToR:*data"},
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"Usage{*duration_nanoseconds}", true, utils.INFIELD_SEP)},
|
||||
{Tag: "UsageSMS", Type: "*composed",
|
||||
Filters: []string{"*string:ToR:*sms"},
|
||||
Filters: []string{"*string:~ToR:*sms"},
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"Usage{*duration_nanoseconds}", true, utils.INFIELD_SEP)},
|
||||
{Tag: "Cost", Type: "*composed",
|
||||
Value: config.NewRSRParsersMustCompile(utils.DynamicDataPrefix+"Cost", true, utils.INFIELD_SEP),
|
||||
|
||||
@@ -115,12 +115,12 @@ func TestChargerAddFilter(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaString,
|
||||
FieldName: "Charger",
|
||||
FieldName: "~Charger",
|
||||
Values: []string{"ChargerProfile1"},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: "UsageInterval",
|
||||
FieldName: "~UsageInterval",
|
||||
Values: []string{(1 * time.Second).String()},
|
||||
},
|
||||
},
|
||||
@@ -132,7 +132,7 @@ func TestChargerAddFilter(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaString,
|
||||
FieldName: "Charger",
|
||||
FieldName: "~Charger",
|
||||
Values: []string{"ChargerProfile2"},
|
||||
},
|
||||
},
|
||||
@@ -144,7 +144,7 @@ func TestChargerAddFilter(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaPrefix,
|
||||
FieldName: "Charger",
|
||||
FieldName: "~harger",
|
||||
Values: []string{"Charger"},
|
||||
},
|
||||
},
|
||||
@@ -156,7 +156,7 @@ func TestChargerAddFilter(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: utils.Weight,
|
||||
FieldName: utils.DynamicDataPrefix + utils.Weight,
|
||||
Values: []string{"200.00"},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -39,7 +39,7 @@ func TestFilterMatchingItemIDsForEvent(t *testing.T) {
|
||||
data, _ := NewMapStorage()
|
||||
dmMatch = NewDataManager(data)
|
||||
context := utils.MetaRating
|
||||
x, err := NewFilterRule(MetaString, "Field", []string{"profile"})
|
||||
x, err := NewFilterRule(MetaString, "~Field", []string{"profile"})
|
||||
if err != nil {
|
||||
t.Errorf("Error: %+v", err)
|
||||
}
|
||||
@@ -49,7 +49,7 @@ func TestFilterMatchingItemIDsForEvent(t *testing.T) {
|
||||
ID: "stringFilter",
|
||||
Rules: stringFilter}
|
||||
dmMatch.SetFilter(attribStringF)
|
||||
x, err = NewFilterRule(MetaPrefix, "Field", []string{"profilePrefix"})
|
||||
x, err = NewFilterRule(MetaPrefix, "~Field", []string{"profilePrefix"})
|
||||
if err != nil {
|
||||
t.Errorf("Error: %+v", err)
|
||||
}
|
||||
@@ -59,7 +59,7 @@ func TestFilterMatchingItemIDsForEvent(t *testing.T) {
|
||||
ID: "prefFilter",
|
||||
Rules: prefixFilter}
|
||||
dmMatch.SetFilter(attribPrefF)
|
||||
x, err = NewFilterRule(MetaGreaterOrEqual, "Weight", []string{"200.00"})
|
||||
x, err = NewFilterRule(MetaGreaterOrEqual, "~Weight", []string{"200.00"})
|
||||
if err != nil {
|
||||
t.Errorf("Error: %+v", err)
|
||||
}
|
||||
|
||||
@@ -35,14 +35,14 @@ func TestFilterPassString(t *testing.T) {
|
||||
ExtraFields: map[string]string{"navigation": "off"},
|
||||
}
|
||||
rf := &FilterRule{Type: MetaString,
|
||||
FieldName: "Category", Values: []string{"call"}}
|
||||
FieldName: "~Category", Values: []string{"call"}}
|
||||
if passes, err := rf.passString(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if !passes {
|
||||
t.Error("Not passes filter")
|
||||
}
|
||||
rf = &FilterRule{Type: MetaString,
|
||||
FieldName: "Category", Values: []string{"cal"}}
|
||||
FieldName: "~Category", Values: []string{"cal"}}
|
||||
if passes, err := rf.passString(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if passes {
|
||||
@@ -50,14 +50,14 @@ func TestFilterPassString(t *testing.T) {
|
||||
}
|
||||
//not
|
||||
rf = &FilterRule{Type: "*notstring",
|
||||
FieldName: "Category", Values: []string{"call"}}
|
||||
FieldName: "~Category", Values: []string{"call"}}
|
||||
if passes, err := rf.Pass(cd, nil, "cgrates.org"); err != nil {
|
||||
t.Error(err)
|
||||
} else if passes {
|
||||
t.Error("Filter passes")
|
||||
}
|
||||
rf = &FilterRule{Type: "*notstring",
|
||||
FieldName: "Category", Values: []string{"cal"}}
|
||||
FieldName: "~Category", Values: []string{"cal"}}
|
||||
if passes, err := rf.Pass(cd, nil, "cgrates.org"); err != nil {
|
||||
t.Error(err)
|
||||
} else if !passes {
|
||||
@@ -76,27 +76,27 @@ func TestFilterPassEmpty(t *testing.T) {
|
||||
DurationIndex: 132 * time.Second,
|
||||
ExtraFields: map[string]string{"navigation": "off"},
|
||||
}
|
||||
rf := &FilterRule{Type: MetaEmpty, FieldName: "Category", Values: []string{}}
|
||||
rf := &FilterRule{Type: MetaEmpty, FieldName: "~Category", Values: []string{}}
|
||||
if passes, err := rf.passEmpty(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if !passes {
|
||||
t.Error("Not passes filter")
|
||||
}
|
||||
rf = &FilterRule{Type: MetaEmpty, FieldName: "ExtraFields", Values: []string{}}
|
||||
rf = &FilterRule{Type: MetaEmpty, FieldName: "~ExtraFields", Values: []string{}}
|
||||
if passes, err := rf.passEmpty(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if passes {
|
||||
t.Error("Filter passes")
|
||||
}
|
||||
cd.ExtraFields = map[string]string{}
|
||||
rf = &FilterRule{Type: MetaEmpty, FieldName: "ExtraFields", Values: []string{}}
|
||||
rf = &FilterRule{Type: MetaEmpty, FieldName: "~ExtraFields", Values: []string{}}
|
||||
if passes, err := rf.passEmpty(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if !passes {
|
||||
t.Error("Not passes filter")
|
||||
}
|
||||
//not
|
||||
rf = &FilterRule{Type: "*notempty", FieldName: "Category", Values: []string{}}
|
||||
rf = &FilterRule{Type: "*notempty", FieldName: "~Category", Values: []string{}}
|
||||
if passes, err := rf.Pass(cd, nil, "cgrates.org"); err != nil {
|
||||
t.Error(err)
|
||||
} else if passes {
|
||||
@@ -115,27 +115,27 @@ func TestFilterPassExists(t *testing.T) {
|
||||
DurationIndex: 132 * time.Second,
|
||||
ExtraFields: map[string]string{"navigation": "off"},
|
||||
}
|
||||
rf := &FilterRule{Type: MetaExists, FieldName: "Category", Values: []string{}}
|
||||
rf := &FilterRule{Type: MetaExists, FieldName: "~Category", Values: []string{}}
|
||||
if passes, err := rf.passExists(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if !passes {
|
||||
t.Error("Not passes filter")
|
||||
}
|
||||
rf = &FilterRule{Type: MetaExists, FieldName: "ExtraFields1", Values: []string{}}
|
||||
rf = &FilterRule{Type: MetaExists, FieldName: "~ExtraFields1", Values: []string{}}
|
||||
if passes, err := rf.passExists(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if passes {
|
||||
t.Error("Filter passes")
|
||||
}
|
||||
cd.ExtraFields = map[string]string{}
|
||||
rf = &FilterRule{Type: MetaExists, FieldName: "ExtraFields", Values: []string{}}
|
||||
rf = &FilterRule{Type: MetaExists, FieldName: "~ExtraFields", Values: []string{}}
|
||||
if passes, err := rf.passExists(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if !passes {
|
||||
t.Error("Not passes filter")
|
||||
}
|
||||
//not
|
||||
rf = &FilterRule{Type: "*notexists", FieldName: "Category1", Values: []string{}}
|
||||
rf = &FilterRule{Type: "*notexists", FieldName: "~Category1", Values: []string{}}
|
||||
if passes, err := rf.Pass(cd, nil, "cgrates.org"); err != nil {
|
||||
t.Error(err)
|
||||
} else if !passes {
|
||||
@@ -154,44 +154,44 @@ func TestFilterPassStringPrefix(t *testing.T) {
|
||||
DurationIndex: 132 * time.Second,
|
||||
ExtraFields: map[string]string{"navigation": "off"},
|
||||
}
|
||||
rf := &FilterRule{Type: MetaPrefix, FieldName: "Category", Values: []string{"call"}}
|
||||
rf := &FilterRule{Type: MetaPrefix, FieldName: "~Category", Values: []string{"call"}}
|
||||
if passes, err := rf.passStringPrefix(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if !passes {
|
||||
t.Error("Not passes filter")
|
||||
}
|
||||
rf = &FilterRule{Type: MetaPrefix, FieldName: "Category", Values: []string{"premium"}}
|
||||
rf = &FilterRule{Type: MetaPrefix, FieldName: "~Category", Values: []string{"premium"}}
|
||||
if passes, err := rf.passStringPrefix(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if passes {
|
||||
t.Error("Passes filter")
|
||||
}
|
||||
rf = &FilterRule{Type: MetaPrefix, FieldName: "Destination", Values: []string{"+49"}}
|
||||
rf = &FilterRule{Type: MetaPrefix, FieldName: "~Destination", Values: []string{"+49"}}
|
||||
if passes, err := rf.passStringPrefix(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if !passes {
|
||||
t.Error("Not passes filter")
|
||||
}
|
||||
rf = &FilterRule{Type: MetaPrefix, FieldName: "Destination", Values: []string{"+499"}}
|
||||
rf = &FilterRule{Type: MetaPrefix, FieldName: "~Destination", Values: []string{"+499"}}
|
||||
if passes, err := rf.passStringPrefix(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if passes {
|
||||
t.Error("Passes filter")
|
||||
}
|
||||
rf = &FilterRule{Type: MetaPrefix, FieldName: "navigation", Values: []string{"off"}}
|
||||
rf = &FilterRule{Type: MetaPrefix, FieldName: "~navigation", Values: []string{"off"}}
|
||||
if passes, err := rf.passStringPrefix(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if !passes {
|
||||
t.Error("Not passes filter")
|
||||
}
|
||||
rf = &FilterRule{Type: MetaPrefix, FieldName: "nonexisting", Values: []string{"off"}}
|
||||
rf = &FilterRule{Type: MetaPrefix, FieldName: "~nonexisting", Values: []string{"off"}}
|
||||
if passing, err := rf.passStringPrefix(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if passing {
|
||||
t.Error("Passes filter")
|
||||
}
|
||||
//not
|
||||
rf = &FilterRule{Type: "*notprefix", FieldName: "Category", Values: []string{"premium"}}
|
||||
rf = &FilterRule{Type: "*notprefix", FieldName: "~Category", Values: []string{"premium"}}
|
||||
if passes, err := rf.Pass(cd, nil, "cgrates.org"); err != nil {
|
||||
t.Error(err)
|
||||
} else if !passes {
|
||||
@@ -210,44 +210,44 @@ func TestFilterPassStringSuffix(t *testing.T) {
|
||||
DurationIndex: 132 * time.Second,
|
||||
ExtraFields: map[string]string{"navigation": "off"},
|
||||
}
|
||||
rf := &FilterRule{Type: MetaSuffix, FieldName: "Category", Values: []string{"call"}}
|
||||
rf := &FilterRule{Type: MetaSuffix, FieldName: "~Category", Values: []string{"call"}}
|
||||
if passes, err := rf.passStringSuffix(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if !passes {
|
||||
t.Error("Not passes filter")
|
||||
}
|
||||
rf = &FilterRule{Type: MetaSuffix, FieldName: "Category", Values: []string{"premium"}}
|
||||
rf = &FilterRule{Type: MetaSuffix, FieldName: "~Category", Values: []string{"premium"}}
|
||||
if passes, err := rf.passStringSuffix(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if passes {
|
||||
t.Error("Passes filter")
|
||||
}
|
||||
rf = &FilterRule{Type: MetaSuffix, FieldName: "Destination", Values: []string{"963"}}
|
||||
rf = &FilterRule{Type: MetaSuffix, FieldName: "~Destination", Values: []string{"963"}}
|
||||
if passes, err := rf.passStringSuffix(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if !passes {
|
||||
t.Error("Not passes filter")
|
||||
}
|
||||
rf = &FilterRule{Type: MetaSuffix, FieldName: "Destination", Values: []string{"4966"}}
|
||||
rf = &FilterRule{Type: MetaSuffix, FieldName: "~Destination", Values: []string{"4966"}}
|
||||
if passes, err := rf.passStringSuffix(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if passes {
|
||||
t.Error("Passes filter")
|
||||
}
|
||||
rf = &FilterRule{Type: MetaSuffix, FieldName: "navigation", Values: []string{"off"}}
|
||||
rf = &FilterRule{Type: MetaSuffix, FieldName: "~navigation", Values: []string{"off"}}
|
||||
if passes, err := rf.passStringSuffix(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if !passes {
|
||||
t.Error("Not passes filter")
|
||||
}
|
||||
rf = &FilterRule{Type: MetaSuffix, FieldName: "nonexisting", Values: []string{"off"}}
|
||||
rf = &FilterRule{Type: MetaSuffix, FieldName: "~nonexisting", Values: []string{"off"}}
|
||||
if passing, err := rf.passStringSuffix(cd); err != nil {
|
||||
t.Error(err)
|
||||
} else if passing {
|
||||
t.Error("Passes filter")
|
||||
}
|
||||
//not
|
||||
rf = &FilterRule{Type: "*notsuffix", FieldName: "Destination", Values: []string{"963"}}
|
||||
rf = &FilterRule{Type: "*notsuffix", FieldName: "~Destination", Values: []string{"963"}}
|
||||
if passes, err := rf.Pass(cd, nil, "cgrates.org"); err != nil {
|
||||
t.Error(err)
|
||||
} else if passes {
|
||||
@@ -318,7 +318,7 @@ func TestFilterPassDestinations(t *testing.T) {
|
||||
DurationIndex: 132 * time.Second,
|
||||
ExtraFields: map[string]string{"navigation": "off"},
|
||||
}
|
||||
rf, err := NewFilterRule(MetaDestinations, "Destination", []string{"DE"})
|
||||
rf, err := NewFilterRule(MetaDestinations, "~Destination", []string{"DE"})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -327,7 +327,7 @@ func TestFilterPassDestinations(t *testing.T) {
|
||||
} else if !passes {
|
||||
t.Error("Not passing")
|
||||
}
|
||||
rf, err = NewFilterRule(MetaDestinations, "Destination", []string{"RO"})
|
||||
rf, err = NewFilterRule(MetaDestinations, "~Destination", []string{"RO"})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -337,7 +337,7 @@ func TestFilterPassDestinations(t *testing.T) {
|
||||
t.Error("Passing")
|
||||
}
|
||||
//not
|
||||
rf, err = NewFilterRule("*notdestinations", "Destination", []string{"DE"})
|
||||
rf, err = NewFilterRule("*notdestinations", "~Destination", []string{"DE"})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -349,7 +349,7 @@ func TestFilterPassDestinations(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFilterPassGreaterThan(t *testing.T) {
|
||||
rf, err := NewFilterRule(MetaLessThan, "ASR", []string{"40"})
|
||||
rf, err := NewFilterRule(MetaLessThan, "~ASR", []string{"40"})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -367,7 +367,7 @@ func TestFilterPassGreaterThan(t *testing.T) {
|
||||
} else if passes {
|
||||
t.Error("equal should not be passing")
|
||||
}
|
||||
rf, err = NewFilterRule(MetaLessOrEqual, "ASR", []string{"40"})
|
||||
rf, err = NewFilterRule(MetaLessOrEqual, "~ASR", []string{"40"})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -376,7 +376,7 @@ func TestFilterPassGreaterThan(t *testing.T) {
|
||||
} else if !passes {
|
||||
t.Error("not passing")
|
||||
}
|
||||
rf, err = NewFilterRule(MetaGreaterOrEqual, "ASR", []string{"40"})
|
||||
rf, err = NewFilterRule(MetaGreaterOrEqual, "~ASR", []string{"40"})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -392,7 +392,7 @@ func TestFilterPassGreaterThan(t *testing.T) {
|
||||
} else if passes {
|
||||
t.Error("should not pass")
|
||||
}
|
||||
rf, err = NewFilterRule(MetaGreaterOrEqual, "ACD", []string{"1m50s"})
|
||||
rf, err = NewFilterRule(MetaGreaterOrEqual, "~ACD", []string{"1m50s"})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -403,22 +403,10 @@ func TestFilterPassGreaterThan(t *testing.T) {
|
||||
} else if !passes {
|
||||
t.Error("not pass")
|
||||
}
|
||||
//not
|
||||
ev = config.NewNavigableMap(nil)
|
||||
ev.Set([]string{"ASR"}, 20, false, true)
|
||||
rf, err = NewFilterRule("*notgt", "ASR", []string{"40"})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if passes, err := rf.passGreaterThan(ev); err != nil {
|
||||
t.Error(err)
|
||||
} else if passes {
|
||||
t.Error("passing")
|
||||
}
|
||||
// Second
|
||||
ev = config.NewNavigableMap(nil)
|
||||
ev.Set([]string{"ASR"}, time.Duration(20*time.Second), false, true)
|
||||
rf, err = NewFilterRule("*gte", "ASR", []string{"10s"})
|
||||
rf, err = NewFilterRule("*gte", "~ASR", []string{"10s"})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -431,7 +419,7 @@ func TestFilterPassGreaterThan(t *testing.T) {
|
||||
//Here converter will be consider part of path and will get error : NOT_FOUND
|
||||
ev = config.NewNavigableMap(nil)
|
||||
ev.Set([]string{"ASR"}, 20, false, true)
|
||||
rf, err = NewFilterRule("*gte", "ASR{*duration_seconds}", []string{"10"})
|
||||
rf, err = NewFilterRule("*gte", "~ASR{*duration_seconds}", []string{"10"})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -443,7 +431,7 @@ func TestFilterPassGreaterThan(t *testing.T) {
|
||||
//Here converter will be consider part of path and will get error : NOT_FOUND
|
||||
ev = config.NewNavigableMap(nil)
|
||||
ev.Set([]string{"ASR"}, 20, false, true)
|
||||
rf, err = NewFilterRule("*gte", "ASR{*duration_seconds}", []string{"10s"})
|
||||
rf, err = NewFilterRule("*gte", "~ASR{*duration_seconds}", []string{"10s"})
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
@@ -455,100 +443,91 @@ func TestFilterPassGreaterThan(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFilterNewRequestFilter(t *testing.T) {
|
||||
rf, err := NewFilterRule(MetaString, "MetaString", []string{"String"})
|
||||
rf, err := NewFilterRule(MetaString, "~MetaString", []string{"String"})
|
||||
if err != nil {
|
||||
t.Errorf("Error: %+v", err)
|
||||
}
|
||||
erf := &FilterRule{Type: MetaString, FieldName: "MetaString", Values: []string{"String"}, negative: utils.BoolPointer(false)}
|
||||
erf := &FilterRule{Type: MetaString, FieldName: "~MetaString", Values: []string{"String"}, negative: utils.BoolPointer(false)}
|
||||
if !reflect.DeepEqual(erf, rf) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", erf, rf)
|
||||
}
|
||||
rf, err = NewFilterRule(MetaEmpty, "MetaEmpty", []string{})
|
||||
rf, err = NewFilterRule(MetaEmpty, "~MetaEmpty", []string{})
|
||||
if err != nil {
|
||||
t.Errorf("Error: %+v", err)
|
||||
}
|
||||
erf = &FilterRule{Type: MetaEmpty, FieldName: "MetaEmpty", Values: []string{}, negative: utils.BoolPointer(false)}
|
||||
erf = &FilterRule{Type: MetaEmpty, FieldName: "~MetaEmpty", Values: []string{}, negative: utils.BoolPointer(false)}
|
||||
if !reflect.DeepEqual(erf, rf) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", erf, rf)
|
||||
}
|
||||
rf, err = NewFilterRule(MetaExists, "MetaExists", []string{})
|
||||
rf, err = NewFilterRule(MetaExists, "~MetaExists", []string{})
|
||||
if err != nil {
|
||||
t.Errorf("Error: %+v", err)
|
||||
}
|
||||
erf = &FilterRule{Type: MetaExists, FieldName: "MetaExists", Values: []string{}, negative: utils.BoolPointer(false)}
|
||||
erf = &FilterRule{Type: MetaExists, FieldName: "~MetaExists", Values: []string{}, negative: utils.BoolPointer(false)}
|
||||
if !reflect.DeepEqual(erf, rf) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", erf, rf)
|
||||
}
|
||||
rf, err = NewFilterRule(MetaPrefix, "MetaPrefix", []string{"stringPrefix"})
|
||||
rf, err = NewFilterRule(MetaPrefix, "~MetaPrefix", []string{"stringPrefix"})
|
||||
if err != nil {
|
||||
t.Errorf("Error: %+v", err)
|
||||
}
|
||||
erf = &FilterRule{Type: MetaPrefix, FieldName: "MetaPrefix", Values: []string{"stringPrefix"}, negative: utils.BoolPointer(false)}
|
||||
erf = &FilterRule{Type: MetaPrefix, FieldName: "~MetaPrefix", Values: []string{"stringPrefix"}, negative: utils.BoolPointer(false)}
|
||||
if !reflect.DeepEqual(erf, rf) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", erf, rf)
|
||||
}
|
||||
rf, err = NewFilterRule(MetaSuffix, "MetaSuffix", []string{"stringSuffix"})
|
||||
rf, err = NewFilterRule(MetaSuffix, "~MetaSuffix", []string{"stringSuffix"})
|
||||
if err != nil {
|
||||
t.Errorf("Error: %+v", err)
|
||||
}
|
||||
erf = &FilterRule{Type: MetaSuffix, FieldName: "MetaSuffix", Values: []string{"stringSuffix"}, negative: utils.BoolPointer(false)}
|
||||
erf = &FilterRule{Type: MetaSuffix, FieldName: "~MetaSuffix", Values: []string{"stringSuffix"}, negative: utils.BoolPointer(false)}
|
||||
if !reflect.DeepEqual(erf, rf) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", erf, rf)
|
||||
}
|
||||
rf, err = NewFilterRule(MetaTimings, "MetaTimings", []string{""})
|
||||
rf, err = NewFilterRule(MetaTimings, "~MetaTimings", []string{""})
|
||||
if err != nil {
|
||||
t.Errorf("Error: %+v", err)
|
||||
}
|
||||
erf = &FilterRule{Type: MetaTimings, FieldName: "MetaTimings", Values: []string{""}, negative: utils.BoolPointer(false)}
|
||||
erf = &FilterRule{Type: MetaTimings, FieldName: "~MetaTimings", Values: []string{""}, negative: utils.BoolPointer(false)}
|
||||
if !reflect.DeepEqual(erf, rf) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", erf, rf)
|
||||
}
|
||||
rf, err = NewFilterRule(MetaDestinations, "MetaDestinations", []string{""})
|
||||
rf, err = NewFilterRule(MetaDestinations, "~MetaDestinations", []string{""})
|
||||
if err != nil {
|
||||
t.Errorf("Error: %+v", err)
|
||||
}
|
||||
erf = &FilterRule{Type: MetaDestinations, FieldName: "MetaDestinations", Values: []string{""}, negative: utils.BoolPointer(false)}
|
||||
erf = &FilterRule{Type: MetaDestinations, FieldName: "~MetaDestinations", Values: []string{""}, negative: utils.BoolPointer(false)}
|
||||
if !reflect.DeepEqual(erf, rf) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", erf, rf)
|
||||
}
|
||||
rf, err = NewFilterRule(MetaLessThan, "MetaLessThan", []string{"20"})
|
||||
rf, err = NewFilterRule(MetaLessThan, "~MetaLessThan", []string{"20"})
|
||||
if err != nil {
|
||||
t.Errorf("Error: %+v", err)
|
||||
}
|
||||
erf = &FilterRule{Type: MetaLessThan, FieldName: "MetaLessThan", Values: []string{"20"}, negative: utils.BoolPointer(false)}
|
||||
erf = &FilterRule{Type: MetaLessThan, FieldName: "~MetaLessThan", Values: []string{"20"}, negative: utils.BoolPointer(false)}
|
||||
if !reflect.DeepEqual(erf, rf) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", erf, rf)
|
||||
}
|
||||
rf, err = NewFilterRule(MetaLessOrEqual, "MetaLessOrEqual", []string{"20"})
|
||||
rf, err = NewFilterRule(MetaLessOrEqual, "~MetaLessOrEqual", []string{"20"})
|
||||
if err != nil {
|
||||
t.Errorf("Error: %+v", err)
|
||||
}
|
||||
erf = &FilterRule{Type: MetaLessOrEqual, FieldName: "MetaLessOrEqual", Values: []string{"20"}, negative: utils.BoolPointer(false)}
|
||||
erf = &FilterRule{Type: MetaLessOrEqual, FieldName: "~MetaLessOrEqual", Values: []string{"20"}, negative: utils.BoolPointer(false)}
|
||||
if !reflect.DeepEqual(erf, rf) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", erf, rf)
|
||||
}
|
||||
rf, err = NewFilterRule(MetaGreaterThan, "MetaGreaterThan", []string{"20"})
|
||||
rf, err = NewFilterRule(MetaGreaterThan, "~MetaGreaterThan", []string{"20"})
|
||||
if err != nil {
|
||||
t.Errorf("Error: %+v", err)
|
||||
}
|
||||
erf = &FilterRule{Type: MetaGreaterThan, FieldName: "MetaGreaterThan", Values: []string{"20"}, negative: utils.BoolPointer(false)}
|
||||
erf = &FilterRule{Type: MetaGreaterThan, FieldName: "~MetaGreaterThan", Values: []string{"20"}, negative: utils.BoolPointer(false)}
|
||||
if !reflect.DeepEqual(erf, rf) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", erf, rf)
|
||||
}
|
||||
rf, err = NewFilterRule(MetaGreaterOrEqual, "MetaGreaterOrEqual", []string{"20"})
|
||||
rf, err = NewFilterRule(MetaGreaterOrEqual, "~MetaGreaterOrEqual", []string{"20"})
|
||||
if err != nil {
|
||||
t.Errorf("Error: %+v", err)
|
||||
}
|
||||
erf = &FilterRule{Type: MetaGreaterOrEqual, FieldName: "MetaGreaterOrEqual", Values: []string{"20"}, negative: utils.BoolPointer(false)}
|
||||
if !reflect.DeepEqual(erf, rf) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", erf, rf)
|
||||
}
|
||||
//not
|
||||
rf, err = NewFilterRule("*notgt", "NotMetaGreaterOrEqual", []string{"20"})
|
||||
if err != nil {
|
||||
t.Errorf("Error: %+v", err)
|
||||
}
|
||||
erf = &FilterRule{Type: "*notgt", FieldName: "NotMetaGreaterOrEqual", Values: []string{"20"}, negative: utils.BoolPointer(true)}
|
||||
erf = &FilterRule{Type: MetaGreaterOrEqual, FieldName: "~MetaGreaterOrEqual", Values: []string{"20"}, negative: utils.BoolPointer(false)}
|
||||
if !reflect.DeepEqual(erf, rf) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", erf, rf)
|
||||
}
|
||||
@@ -569,26 +548,26 @@ func TestInlineFilterPassFiltersForEvent(t *testing.T) {
|
||||
"Account": "1007",
|
||||
}
|
||||
if pass, err := filterS.Pass("cgrates.org",
|
||||
[]string{"*string:Account:1007:error"}, config.NewNavigableMap(failEvent)); err != nil {
|
||||
[]string{"*string:~Account:1007:error"}, config.NewNavigableMap(failEvent)); err != nil {
|
||||
t.Error(err)
|
||||
} else if pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", false, pass)
|
||||
}
|
||||
if pass, err := filterS.Pass("cgrates.org",
|
||||
[]string{"*string:Account:1007"}, config.NewNavigableMap(failEvent)); err != nil {
|
||||
[]string{"*string:~Account:1007"}, config.NewNavigableMap(failEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", false, pass)
|
||||
}
|
||||
if pass, err := filterS.Pass("cgrates.org",
|
||||
[]string{"*string:Account:1007"}, config.NewNavigableMap(passEvent)); err != nil {
|
||||
[]string{"*string:~Account:1007"}, config.NewNavigableMap(passEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if !pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", true, pass)
|
||||
}
|
||||
//not
|
||||
if pass, err := filterS.Pass("cgrates.org",
|
||||
[]string{"*notstring:Account:1007"}, config.NewNavigableMap(passEvent)); err != nil {
|
||||
[]string{"*notstring:~Account:1007"}, config.NewNavigableMap(passEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", false, pass)
|
||||
@@ -600,32 +579,32 @@ func TestInlineFilterPassFiltersForEvent(t *testing.T) {
|
||||
"Account": "1007",
|
||||
}
|
||||
if pass, err := filterS.Pass("cgrates.org",
|
||||
[]string{"*prefix:Account:10"}, config.NewNavigableMap(failEvent)); err != nil {
|
||||
[]string{"*prefix:~Account:10"}, config.NewNavigableMap(failEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", false, pass)
|
||||
}
|
||||
if pass, err := filterS.Pass("cgrates.org",
|
||||
[]string{"*prefix:Account:10"}, config.NewNavigableMap(passEvent)); err != nil {
|
||||
[]string{"*prefix:~Account:10"}, config.NewNavigableMap(passEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if !pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", true, pass)
|
||||
}
|
||||
if pass, err := filterS.Pass("cgrates.org",
|
||||
[]string{"*suffix:Account:07"}, config.NewNavigableMap(failEvent)); err != nil {
|
||||
[]string{"*suffix:~Account:07"}, config.NewNavigableMap(failEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", false, pass)
|
||||
}
|
||||
if pass, err := filterS.Pass("cgrates.org",
|
||||
[]string{"*suffix:Account:07"}, config.NewNavigableMap(passEvent)); err != nil {
|
||||
[]string{"*suffix:~Account:07"}, config.NewNavigableMap(passEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if !pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", true, pass)
|
||||
}
|
||||
//not
|
||||
if pass, err := filterS.Pass("cgrates.org",
|
||||
[]string{"*notsuffix:Account:07"}, config.NewNavigableMap(passEvent)); err != nil {
|
||||
[]string{"*notsuffix:~Account:07"}, config.NewNavigableMap(passEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", false, pass)
|
||||
@@ -664,13 +643,13 @@ func TestInlineFilterPassFiltersForEvent(t *testing.T) {
|
||||
utils.Destination: "+4986517174963",
|
||||
}
|
||||
if pass, err := filterS.Pass("cgrates.org",
|
||||
[]string{"*destinations:Destination:EU"}, config.NewNavigableMap(failEvent)); err != nil {
|
||||
[]string{"*destinations:~Destination:EU"}, config.NewNavigableMap(failEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", false, pass)
|
||||
}
|
||||
if pass, err := filterS.Pass("cgrates.org",
|
||||
[]string{"*destinations:Destination:EU_LANDLINE"}, config.NewNavigableMap(passEvent)); err != nil {
|
||||
[]string{"*destinations:~Destination:EU_LANDLINE"}, config.NewNavigableMap(passEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if !pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", true, pass)
|
||||
@@ -682,13 +661,13 @@ func TestInlineFilterPassFiltersForEvent(t *testing.T) {
|
||||
utils.Weight: 20,
|
||||
}
|
||||
if pass, err := filterS.Pass("cgrates.org",
|
||||
[]string{"*gte:Weight:20"}, config.NewNavigableMap(failEvent)); err != nil {
|
||||
[]string{"*gte:~Weight:20"}, config.NewNavigableMap(failEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", false, pass)
|
||||
}
|
||||
if pass, err := filterS.Pass("cgrates.org",
|
||||
[]string{"*gte:Weight:10"}, config.NewNavigableMap(passEvent)); err != nil {
|
||||
[]string{"*gte:~Weight:10"}, config.NewNavigableMap(passEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if !pass {
|
||||
t.Errorf("Expecting: %+v, received: %+v", true, pass)
|
||||
@@ -715,26 +694,26 @@ func TestInlineFilterPassFiltersForEvent(t *testing.T) {
|
||||
"EmptyPtrMap": &map[string]string{},
|
||||
}
|
||||
for key := range failEvent {
|
||||
if pass, err := filterS.Pass("cgrates.org", []string{"*empty:" + key + ":"},
|
||||
if pass, err := filterS.Pass("cgrates.org", []string{"*empty:~" + key + ":"},
|
||||
config.NewNavigableMap(failEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if pass {
|
||||
t.Errorf("For %s expecting: %+v, received: %+v", key, false, pass)
|
||||
}
|
||||
if pass, err := filterS.Pass("cgrates.org", []string{"*empty:" + key + ":"},
|
||||
if pass, err := filterS.Pass("cgrates.org", []string{"*empty:~" + key + ":"},
|
||||
config.NewNavigableMap(passEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if !pass {
|
||||
t.Errorf("For %s expecting: %+v, received: %+v", key, true, pass)
|
||||
}
|
||||
}
|
||||
if pass, err := filterS.Pass("cgrates.org", []string{"*exists:" + "NewKey" + ":"},
|
||||
if pass, err := filterS.Pass("cgrates.org", []string{"*exists:~NewKey:"},
|
||||
config.NewNavigableMap(failEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if pass {
|
||||
t.Errorf("For NewKey expecting: %+v, received: %+v", false, pass)
|
||||
}
|
||||
if pass, err := filterS.Pass("cgrates.org", []string{"*notexists:" + "NewKey" + ":"},
|
||||
if pass, err := filterS.Pass("cgrates.org", []string{"*notexists:~NewKey:"},
|
||||
config.NewNavigableMap(failEvent)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if !pass {
|
||||
@@ -824,7 +803,7 @@ func TestPassFiltersForEventWithEmptyFilter(t *testing.T) {
|
||||
utils.Usage: "1m20s",
|
||||
}
|
||||
if pass, err := filterS.Pass("cgrates.org",
|
||||
[]string{"*string:Account:1003", "*prefix:Destination:10", "*suffix:Subject:03", "*rsr::~Destination(1002)"},
|
||||
[]string{"*string:~Account:1003", "*prefix:~Destination:10", "*suffix:~Subject:03", "*rsr::~Destination(1002)"},
|
||||
config.NewNavigableMap(ev)); err != nil {
|
||||
t.Errorf(err.Error())
|
||||
} else if !pass {
|
||||
|
||||
@@ -409,22 +409,22 @@ func TestResourceAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaString,
|
||||
FieldName: "Resources",
|
||||
FieldName: "~Resources",
|
||||
Values: []string{"ResourceProfile1"},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: "UsageInterval",
|
||||
FieldName: "~UsageInterval",
|
||||
Values: []string{(1 * time.Second).String()},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: utils.Usage,
|
||||
FieldName: utils.DynamicDataPrefix + utils.Usage,
|
||||
Values: []string{(1 * time.Second).String()},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: utils.Weight,
|
||||
FieldName: utils.DynamicDataPrefix + utils.Weight,
|
||||
Values: []string{"9.0"},
|
||||
},
|
||||
},
|
||||
@@ -436,22 +436,22 @@ func TestResourceAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaString,
|
||||
FieldName: "Resources",
|
||||
FieldName: "~Resources",
|
||||
Values: []string{"ResourceProfile2"},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: "PddInterval",
|
||||
FieldName: "~PddInterval",
|
||||
Values: []string{(1 * time.Second).String()},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: utils.Usage,
|
||||
FieldName: utils.DynamicDataPrefix + utils.Usage,
|
||||
Values: []string{(1 * time.Second).String()},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: utils.Weight,
|
||||
FieldName: utils.DynamicDataPrefix + utils.Weight,
|
||||
Values: []string{"15.0"},
|
||||
},
|
||||
},
|
||||
@@ -463,7 +463,7 @@ func TestResourceAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaPrefix,
|
||||
FieldName: "Resources",
|
||||
FieldName: "~Resources",
|
||||
Values: []string{"ResourceProfilePrefix"},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -151,22 +151,22 @@ func TestStatQueuesAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaString,
|
||||
FieldName: "Stats",
|
||||
FieldName: "~Stats",
|
||||
Values: []string{"StatQueueProfile1"},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: "UsageInterval",
|
||||
FieldName: "~UsageInterval",
|
||||
Values: []string{(1 * time.Second).String()},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: utils.Usage,
|
||||
FieldName: utils.DynamicDataPrefix + utils.Usage,
|
||||
Values: []string{(1 * time.Second).String()},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: utils.Weight,
|
||||
FieldName: utils.DynamicDataPrefix + utils.Weight,
|
||||
Values: []string{"9.0"},
|
||||
},
|
||||
},
|
||||
@@ -178,22 +178,22 @@ func TestStatQueuesAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaString,
|
||||
FieldName: "Stats",
|
||||
FieldName: "~Stats",
|
||||
Values: []string{"StatQueueProfile2"},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: "PddInterval",
|
||||
FieldName: "~PddInterval",
|
||||
Values: []string{(1 * time.Second).String()},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: utils.Usage,
|
||||
FieldName: utils.DynamicDataPrefix + utils.Usage,
|
||||
Values: []string{(1 * time.Second).String()},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: utils.Weight,
|
||||
FieldName: utils.DynamicDataPrefix + utils.Weight,
|
||||
Values: []string{"15.0"},
|
||||
},
|
||||
},
|
||||
@@ -205,7 +205,7 @@ func TestStatQueuesAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaPrefix,
|
||||
FieldName: "Stats",
|
||||
FieldName: "~Stats",
|
||||
Values: []string{"StatQueueProfilePrefix"},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -316,17 +316,17 @@ func TestSuppliersAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaString,
|
||||
FieldName: "Supplier",
|
||||
FieldName: "~Supplier",
|
||||
Values: []string{"SupplierProfile1"},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: "UsageInterval",
|
||||
FieldName: "~UsageInterval",
|
||||
Values: []string{(1 * time.Second).String()},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: utils.Weight,
|
||||
FieldName: utils.DynamicDataPrefix + utils.Weight,
|
||||
Values: []string{"9.0"},
|
||||
},
|
||||
},
|
||||
@@ -338,17 +338,17 @@ func TestSuppliersAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaString,
|
||||
FieldName: "Supplier",
|
||||
FieldName: "~Supplier",
|
||||
Values: []string{"SupplierProfile2"},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: "PddInterval",
|
||||
FieldName: "~PddInterval",
|
||||
Values: []string{(1 * time.Second).String()},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: utils.Weight,
|
||||
FieldName: utils.DynamicDataPrefix + utils.Weight,
|
||||
Values: []string{"15.0"},
|
||||
},
|
||||
},
|
||||
@@ -360,7 +360,7 @@ func TestSuppliersAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaPrefix,
|
||||
FieldName: "Supplier",
|
||||
FieldName: "~Supplier",
|
||||
Values: []string{"SupplierProfilePrefix"},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -163,12 +163,12 @@ func TestThresholdsAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaString,
|
||||
FieldName: "Threshold",
|
||||
FieldName: "~Threshold",
|
||||
Values: []string{"TH_1"},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: utils.Weight,
|
||||
FieldName: utils.DynamicDataPrefix + utils.Weight,
|
||||
Values: []string{"9.0"},
|
||||
},
|
||||
},
|
||||
@@ -180,12 +180,12 @@ func TestThresholdsAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaString,
|
||||
FieldName: "Threshold",
|
||||
FieldName: "~Threshold",
|
||||
Values: []string{"TH_2"},
|
||||
},
|
||||
{
|
||||
Type: MetaGreaterOrEqual,
|
||||
FieldName: utils.Weight,
|
||||
FieldName: utils.DynamicDataPrefix + utils.Weight,
|
||||
Values: []string{"15.0"},
|
||||
},
|
||||
},
|
||||
@@ -197,7 +197,7 @@ func TestThresholdsAddFilters(t *testing.T) {
|
||||
Rules: []*FilterRule{
|
||||
{
|
||||
Type: MetaPrefix,
|
||||
FieldName: "Threshold",
|
||||
FieldName: "~Threshold",
|
||||
Values: []string{"ThresholdPrefix"},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user