Revise test to check for panic in case of rerate for a 0 cost CDR

This commit is contained in:
ionutboangiu
2023-06-22 11:45:25 -04:00
committed by Dan Christian Bogos
parent 3963c07d14
commit ef99675fc3

View File

@@ -129,7 +129,7 @@ func testSes4CDRsProcessCDR(t *testing.T) {
// rerate a free postpaid event in the CDRServer
// will make the BalanceInfo nil and result in a panic
args := &engine.ArgV1ProcessEvent{
Flags: []string{utils.MetaRALs, utils.MetaStore, "*routes:false", utils.MetaRerate},
Flags: []string{utils.MetaRALs, utils.MetaStore, "*routes:false"},
CGREvent: utils.CGREvent{
Tenant: "cgrates.org",
Event: map[string]any{
@@ -147,6 +147,7 @@ func testSes4CDRsProcessCDR(t *testing.T) {
},
}
// Process and store the given CDR.
var reply string
if err := ses4RPC.Call(utils.CDRsV1ProcessEvent, args, &reply); err != nil {
t.Error("Unexpected error: ", err.Error())
@@ -154,6 +155,8 @@ func testSes4CDRsProcessCDR(t *testing.T) {
t.Error("Unexpected reply received: ", reply)
}
// Process the CDR again, after adding the *rerate flag.
args.Flags = append(args.Flags, utils.MetaRerate)
if err := ses4RPC.Call(utils.CDRsV1ProcessEvent, args, &reply); err != nil {
t.Error("Unexpected error: ", err.Error())
} else if reply != utils.OK {