Files
cgrates/dispatchers/replicator_test.go
2022-03-09 14:14:30 +01:00

2116 lines
74 KiB
Go

/*
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
Copyright (C) ITsysCOM GmbH
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package dispatchers
import (
"testing"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
func TestDspReplicatorSv1PingNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
var reply *string
result := dspSrv.ReplicatorSv1Ping(context.Background(), nil, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1PingNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.CGREvent{
Tenant: "tenant",
}
var reply *string
result := dspSrv.ReplicatorSv1Ping(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1PingErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.CGREvent{
Tenant: "tenant",
}
var reply *string
result := dspSrv.ReplicatorSv1Ping(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetStatQueueNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.StatQueue
result := dspSrv.ReplicatorSv1GetStatQueue(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetStatQueueErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.StatQueue
result := dspSrv.ReplicatorSv1GetStatQueue(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetFilterNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.Filter
result := dspSrv.ReplicatorSv1GetFilter(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetFilterErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.Filter
result := dspSrv.ReplicatorSv1GetFilter(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetThresholdNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.Threshold
result := dspSrv.ReplicatorSv1GetThreshold(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetThresholdErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.Threshold
result := dspSrv.ReplicatorSv1GetThreshold(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetThresholdProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.ThresholdProfile
result := dspSrv.ReplicatorSv1GetThresholdProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetThresholdProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.ThresholdProfile
result := dspSrv.ReplicatorSv1GetThresholdProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetStatQueueProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.StatQueueProfile
result := dspSrv.ReplicatorSv1GetStatQueueProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetStatQueueProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.StatQueueProfile
result := dspSrv.ReplicatorSv1GetStatQueueProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetResourceNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.Resource
result := dspSrv.ReplicatorSv1GetResource(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetResourceErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.Resource
result := dspSrv.ReplicatorSv1GetResource(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetResourceProfileReplicatorSv1GetResourceProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.ResourceProfile
result := dspSrv.ReplicatorSv1GetResourceProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetResourceProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.ResourceProfile
result := dspSrv.ReplicatorSv1GetResourceProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetRouteProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.RouteProfile
result := dspSrv.ReplicatorSv1GetRouteProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetRouteProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.RouteProfile
result := dspSrv.ReplicatorSv1GetRouteProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetAttributeProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.AttributeProfile
result := dspSrv.ReplicatorSv1GetAttributeProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetAttributeProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.AttributeProfile
result := dspSrv.ReplicatorSv1GetAttributeProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetChargerProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.ChargerProfile
result := dspSrv.ReplicatorSv1GetChargerProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetChargerProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.ChargerProfile
result := dspSrv.ReplicatorSv1GetChargerProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetDispatcherProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.DispatcherProfile
result := dspSrv.ReplicatorSv1GetDispatcherProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetDispatcherProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.DispatcherProfile
result := dspSrv.ReplicatorSv1GetDispatcherProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetDispatcherHostNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.DispatcherHost
result := dspSrv.ReplicatorSv1GetDispatcherHost(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetDispatcherHostErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.DispatcherHost
result := dspSrv.ReplicatorSv1GetDispatcherHost(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetItemLoadIDsNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
var reply *map[string]int64
result := dspSrv.ReplicatorSv1GetItemLoadIDs(context.Background(), nil, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetItemLoadIDsNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.StringWithAPIOpts{
Tenant: "tenant",
}
var reply *map[string]int64
result := dspSrv.ReplicatorSv1GetItemLoadIDs(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetItemLoadIDsErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.StringWithAPIOpts{
Tenant: "tenant",
}
var reply *map[string]int64
result := dspSrv.ReplicatorSv1GetItemLoadIDs(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetThresholdProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &engine.ThresholdProfileWithAPIOpts{
ThresholdProfile: &engine.ThresholdProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetThresholdProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetThresholdProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &engine.ThresholdProfileWithAPIOpts{
ThresholdProfile: &engine.ThresholdProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetThresholdProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveFilterNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveFilter(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveFilterErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveFilter(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveFilterNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1RemoveFilter(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveThresholdProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveThresholdProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveThresholdProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveThresholdProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveThresholdProfileNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1RemoveThresholdProfile(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveStatQueueProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveStatQueueProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveStatQueueProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveStatQueueProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveStatQueueProfileNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1RemoveStatQueueProfile(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveResourceNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveResource(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveResourceErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveResource(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveResourceNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1RemoveResource(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveResourceProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveResourceProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveResourceProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveResourceProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveResourceProfileNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1RemoveResourceProfile(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveRouteProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveRouteProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveRouteProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveRouteProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveRouteProfileNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1RemoveRouteProfile(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveAttributeProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveAttributeProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveAttributeProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveAttributeProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveAttributeProfileNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1RemoveAttributeProfile(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveChargerProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveChargerProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveChargerProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveChargerProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveChargerProfileNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1RemoveChargerProfile(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveDispatcherHostNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveDispatcherHost(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveDispatcherHostErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveDispatcherHost(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveDispatcherHostNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1RemoveDispatcherHost(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveDispatcherProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveDispatcherProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveDispatcherProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveDispatcherProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveDispatcherProfileNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1RemoveDispatcherProfile(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetIndexesNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.GetIndexesArg{
Tenant: "tenant",
}
var reply *map[string]utils.StringSet
result := dspSrv.ReplicatorSv1GetIndexes(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetIndexesErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.GetIndexesArg{
Tenant: "tenant",
}
var reply *map[string]utils.StringSet
result := dspSrv.ReplicatorSv1GetIndexes(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetIndexesNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *map[string]utils.StringSet
result := dspSrv.ReplicatorSv1GetIndexes(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetIndexesNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.SetIndexesArg{
Tenant: "tenant",
}
var reply *string
result := dspSrv.ReplicatorSv1SetIndexes(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetIndexesErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.SetIndexesArg{
Tenant: "tenant",
}
var reply *string
result := dspSrv.ReplicatorSv1SetIndexes(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetIndexesNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1SetIndexes(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveIndexesNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.GetIndexesArg{
Tenant: "tenant",
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveIndexes(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetLoadIDsNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.LoadIDsWithAPIOpts{
Tenant: "tenant",
}
var reply *string
result := dspSrv.ReplicatorSv1SetLoadIDs(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetLoadIDsErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.LoadIDsWithAPIOpts{
Tenant: "tenant",
}
var reply *string
result := dspSrv.ReplicatorSv1SetLoadIDs(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetLoadIDsNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1SetLoadIDs(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveAccountNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveAccount(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveAccountErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveAccount(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveAccountNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1RemoveAccount(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveStatQueueNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveStatQueue(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveStatQueueErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveStatQueue(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveStatQueueNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1RemoveStatQueue(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveIndexesErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.GetIndexesArg{
Tenant: "tenant",
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveIndexes(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveIndexesNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1RemoveIndexes(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetThresholdProfileNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1SetThresholdProfile(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetThresholdNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &engine.ThresholdWithAPIOpts{
Threshold: &engine.Threshold{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetThreshold(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetThresholdErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &engine.ThresholdWithAPIOpts{
Threshold: &engine.Threshold{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetThreshold(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetThresholdNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1SetThreshold(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetAccountNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.AccountWithAPIOpts{
Account: &utils.Account{},
}
var reply *string
result := dspSrv.ReplicatorSv1SetAccount(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetAccountErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.AccountWithAPIOpts{
Account: &utils.Account{
ID: "testID",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetAccount(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetAccountNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1SetAccount(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetStatQueueNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &engine.StatQueueWithAPIOpts{
StatQueue: &engine.StatQueue{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetStatQueue(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetStatQueueErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &engine.StatQueueWithAPIOpts{
StatQueue: &engine.StatQueue{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetStatQueue(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetStatQueueNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1SetStatQueue(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetFilterNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &engine.FilterWithAPIOpts{
Filter: &engine.Filter{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetFilter(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetFilterErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &engine.FilterWithAPIOpts{
Filter: &engine.Filter{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetFilter(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetFilterNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1SetFilter(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetStatQueueProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &engine.StatQueueProfileWithAPIOpts{
StatQueueProfile: &engine.StatQueueProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetStatQueueProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetStatQueueProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &engine.StatQueueProfileWithAPIOpts{
StatQueueProfile: &engine.StatQueueProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetStatQueueProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetStatQueueProfileNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1SetStatQueueProfile(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetResourceNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &engine.ResourceWithAPIOpts{
Resource: &engine.Resource{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetResource(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetResourceErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &engine.ResourceWithAPIOpts{
Resource: &engine.Resource{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetResource(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetResourceNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1SetResource(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetResourceProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &engine.ResourceProfileWithAPIOpts{
ResourceProfile: &engine.ResourceProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetResourceProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestReplicatorSv1SetResourceProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &engine.ResourceProfileWithAPIOpts{
ResourceProfile: &engine.ResourceProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetResourceProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetResourceProfileNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1SetResourceProfile(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetRouteProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &engine.RouteProfileWithAPIOpts{
RouteProfile: &engine.RouteProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetRouteProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetRouteProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &engine.RouteProfileWithAPIOpts{
RouteProfile: &engine.RouteProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetRouteProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetRouteProfileNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1SetRouteProfile(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetAttributeProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &engine.AttributeProfileWithAPIOpts{
AttributeProfile: &engine.AttributeProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetAttributeProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetAttributeProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &engine.AttributeProfileWithAPIOpts{
AttributeProfile: &engine.AttributeProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetAttributeProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetAttributeProfileNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1SetAttributeProfile(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetChargerProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &engine.ChargerProfileWithAPIOpts{
ChargerProfile: &engine.ChargerProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetChargerProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetChargerProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &engine.ChargerProfileWithAPIOpts{
ChargerProfile: &engine.ChargerProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetChargerProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetChargerProfileNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1SetChargerProfile(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetDispatcherProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &engine.DispatcherProfileWithAPIOpts{
DispatcherProfile: &engine.DispatcherProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetDispatcherProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetDispatcherProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &engine.DispatcherProfileWithAPIOpts{
DispatcherProfile: &engine.DispatcherProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetDispatcherProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetDispatcherProfileNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1SetDispatcherProfile(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetDispatcherHostNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &engine.DispatcherHostWithAPIOpts{
DispatcherHost: &engine.DispatcherHost{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetDispatcherHost(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestReplicatorSv1SetDispatcherHostErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &engine.DispatcherHostWithAPIOpts{
DispatcherHost: &engine.DispatcherHost{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetDispatcherHost(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetDispatcherHostNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1SetDispatcherHost(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveThresholdNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveThreshold(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestReplicatorSv1RemoveThresholdErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveThreshold(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveThresholdNilEvent(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
var reply *string
result := dspSrv.ReplicatorSv1RemoveThreshold(context.Background(), nil, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetRateProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *utils.RateProfile
result := dspSrv.ReplicatorSv1GetRateProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetRateProfileErrorTenant(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *utils.RateProfile
result := dspSrv.ReplicatorSv1GetRateProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetRateProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{}
var reply *utils.RateProfile
result := dspSrv.ReplicatorSv1GetRateProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetActionProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.ActionProfile
result := dspSrv.ReplicatorSv1GetActionProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetActionProfileErrorTenant(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.ActionProfile
result := dspSrv.ReplicatorSv1GetActionProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetActionProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *engine.ActionProfile
result := dspSrv.ReplicatorSv1GetActionProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetActionProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &engine.ActionProfileWithAPIOpts{
ActionProfile: &engine.ActionProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetActionProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetActionProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &engine.ActionProfileWithAPIOpts{
ActionProfile: &engine.ActionProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetActionProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetActionProfileErrorNilArgs(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
var reply *string
result := dspSrv.ReplicatorSv1SetActionProfile(context.Background(), nil, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetRateProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.RateProfileWithAPIOpts{
RateProfile: &utils.RateProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetRateProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetRateProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.RateProfileWithAPIOpts{
RateProfile: &utils.RateProfile{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1SetRateProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1SetRateProfileErrorNilArgs(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
var reply *string
result := dspSrv.ReplicatorSv1SetRateProfile(context.Background(), nil, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveRateProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveRateProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDsReplicatorSv1RemoveRateProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveRateProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveRateProfileErrorNilArgs(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
var reply *string
result := dspSrv.ReplicatorSv1RemoveRateProfile(context.Background(), nil, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveActionProfileNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveActionProfile(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1RemoveActionProfileErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *string
result := dspSrv.ReplicatorSv1RemoveActionProfile(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestReplicatorSv1RemoveActionProfileNilArgs(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
var reply *string
result := dspSrv.ReplicatorSv1RemoveActionProfile(context.Background(), nil, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetAccountErrorNil(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *utils.Account
result := dspSrv.ReplicatorSv1GetAccount(context.Background(), CGREvent, reply)
expected := "MANDATORY_IE_MISSING: [ApiKey]"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}
func TestDspReplicatorSv1GetAccountErrorCase2(t *testing.T) {
cgrCfg := config.NewDefaultCGRConfig()
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
CGREvent := &utils.TenantIDWithAPIOpts{
TenantID: &utils.TenantID{
Tenant: "tenant",
},
}
var reply *utils.Account
result := dspSrv.ReplicatorSv1GetAccount(context.Background(), CGREvent, reply)
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
if result == nil || result.Error() != expected {
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
}
}