diff --git a/engine/caches_test.go b/engine/caches_test.go index 9afe0b503..0ca753f54 100644 --- a/engine/caches_test.go +++ b/engine/caches_test.go @@ -1032,3 +1032,39 @@ func TestCacheSBeginTransaction(t *testing.T) { } } + +func TestCachesV1ReLoadCache(t *testing.T) { + cfg := config.NewDefaultCGRConfig() + tmpDm := dm + defer func() { + dm = tmpDm + }() + attr := &utils.AttrReloadCacheWithAPIOpts{ + Tenant: "cgrates.org", + FilterIDs: []string{"cgrates.org:FLTR_ID"}, + AttributeFilterIndexIDs: []string{"cgrates.org:*any:*string:*req.Account:1001", "cgrates.org:*any:*string:*req.Account:1002"}, + } + chS := NewCacheS(cfg, dm, nil) + var reply string + if err := chS.V1ReloadCache(context.Background(), attr, &reply); err != nil { + t.Error(err) + } else if reply != utils.OK { + t.Errorf("reply should be %v", utils.OK) + } + +} + +func TestCachesCall(t *testing.T) { + chS := CacheS{} + + ctx := context.Background() + serviceMethod := "Method" + args := "Args" + reply := "Reply" + + err := chS.Call(ctx, serviceMethod, args, reply) + + if err == nil { + t.Errorf("Call returned an unexpected error: %v", err) + } +} diff --git a/engine/stats_test.go b/engine/stats_test.go index 42f1f008b..3da4f1e16 100644 --- a/engine/stats_test.go +++ b/engine/stats_test.go @@ -31,6 +31,7 @@ import ( "github.com/cgrates/birpc" "github.com/cgrates/birpc/context" "github.com/cgrates/cgrates/config" + "github.com/cgrates/cgrates/utils" ) @@ -3374,3 +3375,26 @@ func TestStatQueueProcessEventErr(t *testing.T) { } } + +func TestStatServiceCall(t *testing.T) { + + tDM := &DataManager{} + tConnMgr := &ConnManager{} + tFilterS := &FilterS{} + tCGRConfig := &config.CGRConfig{} + statService := &StatService{ + dm: tDM, + connMgr: tConnMgr, + filterS: tFilterS, + cgrcfg: tCGRConfig, + } + ctx := context.Background() + serviceMethod := "" + args := "" + reply := "" + err := statService.Call(ctx, serviceMethod, args, &reply) + if err == nil { + t.Errorf("Call method returned error: %v", err) + } + +}