mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
updated threshold implementation
This commit is contained in:
committed by
Dan Christian Bogos
parent
5444973349
commit
2d94ca89bb
@@ -256,8 +256,10 @@ func testAccWThdGetAccountAfterDebit(t *testing.T) {
|
||||
|
||||
func testAccWThdGetThresholdAfterDebit(t *testing.T) {
|
||||
var result2 *engine.Threshold
|
||||
if err := accWThdRpc.Call(context.Background(), utils.ThresholdSv1GetThreshold, &utils.TenantIDWithAPIOpts{TenantID: &utils.TenantID{Tenant: "cgrates.org", ID: "THD_ACNT_1002"}}, &result2); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := accWThdRpc.Call(context.Background(), utils.ThresholdSv1GetThreshold, &utils.TenantIDWithAPIOpts{TenantID: &utils.TenantID{Tenant: "cgrates.org", ID: "THD_ACNT_1002"}}, &result2); err != nil {
|
||||
t.Error(err)
|
||||
} else if result2.Hits != 1 {
|
||||
t.Errorf("expected to have reached MaxHits")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -300,8 +300,8 @@ func testFraudAuthorizeandProcess1(t *testing.T) {
|
||||
}
|
||||
var reply string
|
||||
if err := fraudRPC.Call(context.Background(), utils.SessionSv1ProcessCDR,
|
||||
cgrEv, &reply); err == nil || err.Error() != utils.ErrPartiallyExecuted.Error() {
|
||||
t.Errorf("expected: <%+v>, \nreceived: <%+v>", utils.ErrPartiallyExecuted, err)
|
||||
cgrEv, &reply); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,8 +350,8 @@ func testFraudAuthorizeandProcess2(t *testing.T) {
|
||||
}
|
||||
var reply string
|
||||
if err := fraudRPC.Call(context.Background(), utils.SessionSv1ProcessCDR,
|
||||
cgrEv, &reply); err == nil || err.Error() != utils.ErrPartiallyExecuted.Error() {
|
||||
t.Errorf("expected: <%+v>, \nreceived: <%+v>", utils.ErrPartiallyExecuted, err)
|
||||
cgrEv, &reply); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user