mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Updated migrator integration tests for latest changes
This commit is contained in:
committed by
Dan Christian Bogos
parent
c937a2427d
commit
f9f97ce256
@@ -133,7 +133,7 @@ func (fS *FilterS) Pass(tenant string, filterIDs []string,
|
||||
// NewFilterFromInline parses an inline rule into a compiled Filter
|
||||
func NewFilterFromInline(tenant, inlnRule string) (f *Filter, err error) {
|
||||
ruleSplt := strings.Split(inlnRule, utils.InInFieldSep)
|
||||
if len(ruleSplt) != 3 {
|
||||
if len(ruleSplt) < 3 {
|
||||
return nil, fmt.Errorf("inline parse error for string: <%s>", inlnRule)
|
||||
}
|
||||
f = &Filter{
|
||||
@@ -142,7 +142,7 @@ func NewFilterFromInline(tenant, inlnRule string) (f *Filter, err error) {
|
||||
Rules: []*FilterRule{{
|
||||
Type: ruleSplt[0],
|
||||
FieldName: ruleSplt[1],
|
||||
Values: strings.Split(ruleSplt[2], utils.INFIELD_SEP),
|
||||
Values: strings.Split(strings.Join(ruleSplt[2:], utils.InInFieldSep), utils.INFIELD_SEP),
|
||||
}},
|
||||
}
|
||||
if err = f.Compile(); err != nil {
|
||||
|
||||
@@ -568,9 +568,11 @@ func TestInlineFilterPassFiltersForEvent(t *testing.T) {
|
||||
passEvent := map[string]interface{}{
|
||||
"Account": "1007",
|
||||
}
|
||||
if _, err := filterS.Pass("cgrates.org",
|
||||
[]string{"*string:Account:1007:error"}, nil); err == nil {
|
||||
t.Errorf(err.Error())
|
||||
if pass, err := filterS.Pass("cgrates.org",
|
||||
[]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 {
|
||||
|
||||
@@ -176,7 +176,7 @@ func testAlsITMigrateAndMove(t *testing.T) {
|
||||
},
|
||||
},
|
||||
Blocker: false,
|
||||
Weight: 10,
|
||||
Weight: 20,
|
||||
}
|
||||
attrProf.Compile()
|
||||
switch alsAction {
|
||||
|
||||
@@ -146,8 +146,8 @@ func testDCITMigrateAndMove(t *testing.T) {
|
||||
DestinationIDs: utils.StringMap{"1001": true, "1002": true, "1003": true},
|
||||
Chargers: []*v1DerivedCharger{
|
||||
&v1DerivedCharger{
|
||||
RunID: "RunID",
|
||||
// RunFilters: "~filterhdr1:s/(.+)/special_run3/",
|
||||
RunID: "RunID",
|
||||
RunFilters: "~filterhdr1:s/(.+)/special_run3/",
|
||||
|
||||
RequestTypeField: utils.MetaDefault,
|
||||
CategoryField: utils.MetaDefault,
|
||||
@@ -190,7 +190,7 @@ func testDCITMigrateAndMove(t *testing.T) {
|
||||
FilterIDs: []string{
|
||||
"*destination:Destination:1001;1002;1003",
|
||||
"*string:Account:1003",
|
||||
// "*rsr::~filterhdr1:s/(.+)/special_run3/",
|
||||
"*rsr::~filterhdr1:s/(.+)/special_run3/",
|
||||
},
|
||||
ActivationInterval: nil,
|
||||
RunID: "RunID",
|
||||
|
||||
Reference in New Issue
Block a user