Fix integration tests

This commit is contained in:
ionutboangiu
2021-11-22 17:32:37 +02:00
committed by Dan Christian Bogos
parent 8a4c982af6
commit 941531039e
5 changed files with 6 additions and 14 deletions

View File

@@ -345,7 +345,7 @@ func testChargerSProcessEvent(t *testing.T) {
}
if err := chargerRPC.Call(utils.ChargerSv1ProcessEvent, chargerEvent[0], &result); err != nil {
t.Error(err)
} else if !reflect.DeepEqual(result, processedEv) {
} else if utils.ToJSON(result) != utils.ToJSON(processedEv) {
t.Errorf("Expecting : %s, received: %s", utils.ToJSON(processedEv), utils.ToJSON(result))
}
result = []*engine.ChrgSProcessEventReply{}
@@ -375,7 +375,7 @@ func testChargerSProcessEvent(t *testing.T) {
t.Fatal(err)
}
sort.Strings(result[0].AlteredFields)
if !reflect.DeepEqual(result, processedEv) {
if utils.ToJSON(result) != utils.ToJSON(processedEv) {
t.Errorf("Expecting : %s, received: %s", utils.ToJSON(processedEv), utils.ToJSON(result))
}
@@ -384,7 +384,7 @@ func testChargerSProcessEvent(t *testing.T) {
t.Fatal(err)
}
sort.Strings(result[0].AlteredFields)
if !reflect.DeepEqual(result, processedEv) {
if utils.ToJSON(result) != utils.ToJSON(processedEv) {
t.Errorf("Expecting : %s, received: %s", utils.ToJSON(processedEv), utils.ToJSON(result))
}
}
@@ -625,7 +625,7 @@ func testChargerSProccessEventWithProcceSRunS(t *testing.T) {
var result2 []*engine.ChrgSProcessEventReply
if err := chargerRPC.Call(utils.ChargerSv1ProcessEvent, cgrEv, &result2); err != nil {
t.Error(err)
} else if !reflect.DeepEqual(result2, processedEv) {
} else if utils.ToJSON(result2) != utils.ToJSON(processedEv) {
t.Errorf("Expecting : %s, received: %s", utils.ToJSON(processedEv), utils.ToJSON(result2))
}
}

View File

@@ -334,7 +334,6 @@ func testCGRConfigReloadSupplierS(t *testing.T) {
Context: utils.MetaRoutes,
IgnoreErrors: false,
MaxCost: utils.EmptyString,
ProfileCount: 1,
},
}
if !reflect.DeepEqual(expAttr, cfg.RouteSCfg()) {

View File

@@ -1181,7 +1181,6 @@ func TestDfRouteSJsonCfg(t *testing.T) {
Context: utils.StringPointer(utils.MetaRoutes),
IgnoreErrors: utils.BoolPointer(false),
MaxCost: utils.EmptyString,
ProfileCount: utils.IntPointer(1),
},
}
dfCgrJSONCfg, err := NewCgrJsonCfgFromBytes([]byte(CGRATES_CFG_JSON))

File diff suppressed because one or more lines are too long

View File

@@ -54,7 +54,6 @@ func TestRouteSCfgloadFromJsonCfg(t *testing.T) {
Context: utils.MetaRoutes,
IgnoreErrors: false,
MaxCost: utils.EmptyString,
ProfileCount: 1,
},
}
jsonCfg := NewDefaultCGRConfig()
@@ -82,7 +81,6 @@ func TestRouteSCfgAsMapInterface(t *testing.T) {
utils.DefaultRatioCfg: 1,
utils.OptsCfg: map[string]interface{}{
utils.OptsContext: utils.MetaRoutes,
utils.MetaProfileCountCfg: 1,
utils.MetaIgnoreErrorsCfg: false,
utils.MetaMaxCostCfg: utils.EmptyString,
},
@@ -124,7 +122,6 @@ func TestRouteSCfgAsMapInterface1(t *testing.T) {
utils.DefaultRatioCfg: 2,
utils.OptsCfg: map[string]interface{}{
utils.OptsContext: utils.MetaRoutes,
utils.MetaProfileCountCfg: 1,
utils.MetaIgnoreErrorsCfg: false,
utils.MetaMaxCostCfg: utils.EmptyString,
},