mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
3071 lines
106 KiB
Go
3071 lines
106 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/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(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(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(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetAccountNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
var reply *engine.Account
|
|
result := dspSrv.ReplicatorSv1GetAccount(nil, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetAccountNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.Account
|
|
result := dspSrv.ReplicatorSv1GetAccount(CGREvent, 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)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.Account
|
|
result := dspSrv.ReplicatorSv1GetAccount(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetDestinationNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
|
|
var reply *engine.Destination
|
|
result := dspSrv.ReplicatorSv1GetDestination(nil, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetDestinationNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.Destination
|
|
result := dspSrv.ReplicatorSv1GetDestination(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetDestinationErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.Destination
|
|
result := dspSrv.ReplicatorSv1GetDestination(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetReverseDestinationNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
var reply *[]string
|
|
result := dspSrv.ReplicatorSv1GetReverseDestination(nil, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetReverseDestinationNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *[]string
|
|
result := dspSrv.ReplicatorSv1GetReverseDestination(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetReverseDestinationErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *[]string
|
|
result := dspSrv.ReplicatorSv1GetReverseDestination(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(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(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(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(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(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(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(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(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(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(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetTimingNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
var reply *utils.TPTiming
|
|
result := dspSrv.ReplicatorSv1GetTiming(nil, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetTimingNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *utils.TPTiming
|
|
result := dspSrv.ReplicatorSv1GetTiming(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetTimingErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *utils.TPTiming
|
|
result := dspSrv.ReplicatorSv1GetTiming(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(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(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(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(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetActionTriggersNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
var reply *engine.ActionTriggers
|
|
result := dspSrv.ReplicatorSv1GetActionTriggers(nil, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetActionTriggersNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.ActionTriggers
|
|
result := dspSrv.ReplicatorSv1GetActionTriggers(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetActionTriggersErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.ActionTriggers
|
|
result := dspSrv.ReplicatorSv1GetActionTriggers(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetSharedGroupNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
var reply *engine.SharedGroup
|
|
result := dspSrv.ReplicatorSv1GetSharedGroup(nil, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetSharedGroupNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.SharedGroup
|
|
result := dspSrv.ReplicatorSv1GetSharedGroup(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetSharedGroupErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.SharedGroup
|
|
result := dspSrv.ReplicatorSv1GetSharedGroup(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetActionsNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
var reply *engine.Actions
|
|
result := dspSrv.ReplicatorSv1GetActions(nil, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetActionsNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.Actions
|
|
result := dspSrv.ReplicatorSv1GetActions(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetActionsErrorNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *engine.Actions
|
|
result := dspSrv.ReplicatorSv1GetActions(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetActionsErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.Actions
|
|
result := dspSrv.ReplicatorSv1GetActions(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetActionPlanNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.ActionPlan
|
|
result := dspSrv.ReplicatorSv1GetActionPlan(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetActionPlanErrorNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *engine.ActionPlan
|
|
result := dspSrv.ReplicatorSv1GetActionPlan(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetActionPlanErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.ActionPlan
|
|
result := dspSrv.ReplicatorSv1GetActionPlan(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetAllActionPlansNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
var reply *map[string]*engine.ActionPlan
|
|
result := dspSrv.ReplicatorSv1GetAllActionPlans(nil, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetAllActionPlansNil(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]*engine.ActionPlan
|
|
result := dspSrv.ReplicatorSv1GetAllActionPlans(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetAllActionPlansErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *map[string]*engine.ActionPlan
|
|
result := dspSrv.ReplicatorSv1GetAllActionPlans(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetAccountActionPlansNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
var reply *[]string
|
|
result := dspSrv.ReplicatorSv1GetAccountActionPlans(nil, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetAccountActionPlansNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *[]string
|
|
result := dspSrv.ReplicatorSv1GetAccountActionPlans(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetAccountActionPlansErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *[]string
|
|
result := dspSrv.ReplicatorSv1GetAccountActionPlans(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetRatingPlanNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
|
|
var reply *engine.RatingPlan
|
|
result := dspSrv.ReplicatorSv1GetRatingPlan(nil, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetRatingPlanNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.RatingPlan
|
|
result := dspSrv.ReplicatorSv1GetRatingPlan(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetRatingPlanErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.RatingPlan
|
|
result := dspSrv.ReplicatorSv1GetRatingPlan(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetRatingProfileNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
var reply *engine.RatingProfile
|
|
result := dspSrv.ReplicatorSv1GetRatingProfile(nil, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetRatingProfileNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.RatingProfile
|
|
result := dspSrv.ReplicatorSv1GetRatingProfile(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1GetRatingProfileErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *engine.RatingProfile
|
|
result := dspSrv.ReplicatorSv1GetRatingProfile(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(CGREvent, 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(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(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(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(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetDestinationNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &engine.DestinationWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetDestination(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetDestinationErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &engine.DestinationWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetDestination(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetDestinationNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetDestination(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 := &engine.AccountWithAPIOpts{
|
|
Account: &engine.Account{},
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetAccount(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 := &engine.AccountWithAPIOpts{
|
|
Account: &engine.Account{
|
|
ID: "testID",
|
|
},
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetAccount(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(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetReverseDestinationNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &engine.DestinationWithAPIOpts{
|
|
Destination: &engine.Destination{
|
|
Id: "testID",
|
|
},
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetReverseDestination(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetReverseDestinationErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &engine.DestinationWithAPIOpts{
|
|
Destination: &engine.Destination{
|
|
Id: "testID",
|
|
},
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetReverseDestination(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetReverseDestinationNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetReverseDestination(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(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(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(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(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(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(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(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(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(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetTimingNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.TPTimingWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetTiming(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetTimingErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.TPTimingWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetTiming(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetTimingNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetTiming(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(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(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(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(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(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(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetSharedGroupNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &engine.SharedGroupWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetSharedGroup(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestReplicatorSv1SetSharedGroupErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &engine.SharedGroupWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetSharedGroup(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetSharedGroupNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetSharedGroup(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetActionsNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &engine.SetActionsArgsWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetActions(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestReplicatorSv1SetActionsErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &engine.SetActionsArgsWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetActions(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetActionsNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetActions(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetRatingProfileNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &engine.RatingProfileWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetRatingProfile(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestReplicatorSv1SetRatingProfileErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &engine.RatingProfileWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetRatingProfile(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetRatingProfileNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetRatingProfile(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetRatingPlanNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &engine.RatingPlanWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetRatingPlan(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetRatingPlanErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &engine.RatingPlanWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetRatingPlan(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetRatingPlanNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetRatingPlan(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetActionTriggersNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &engine.SetActionTriggersArgWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetActionTriggers(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetActionTriggersErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &engine.SetActionTriggersArgWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetActionTriggers(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetActionTriggersNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetActionTriggers(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(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(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(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(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(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(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(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(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(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(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(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(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetActionPlanNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &engine.SetActionPlanArgWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetActionPlan(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetActionPlanErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &engine.SetActionPlanArgWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetActionPlan(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetActionPlanNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetActionPlan(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetAccountActionPlansNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &engine.SetAccountActionPlansArgWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetAccountActionPlans(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetAccountActionPlansErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &engine.SetAccountActionPlansArgWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetAccountActionPlans(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1SetAccountActionPlansNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1SetAccountActionPlans(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(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(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(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(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(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveDestinationNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveDestination(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveDestinationNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveDestination(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestReplicatorSv1RemoveDestinationErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveDestination(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
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(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(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(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.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveAccount(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.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveAccount(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(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(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(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(nil, 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(nil, 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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveTimingNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveTiming(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveTimingErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveTiming(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveTimingNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveTiming(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveActionTriggersNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveActionTriggers(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveActionTriggersErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveActionTriggers(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveActionTriggersNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveActionTriggers(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveSharedGroupNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveSharedGroup(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveSharedGroupErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveSharedGroup(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveSharedGroupNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveSharedGroup(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveActionsNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveActions(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveActionsErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveActions(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveActionsEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveActions(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveActionPlanNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveActionPlan(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveActionPlanErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveActionPlan(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveActionPlanNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveActionPlan(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
func TestDspReplicatorSv1RemAccountActionPlansNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &engine.RemAccountActionPlansArgsWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemAccountActionPlans(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemAccountActionPlansErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &engine.RemAccountActionPlansArgsWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemAccountActionPlans(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemAccountActionPlansNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemAccountActionPlans(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveRatingPlanNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveRatingPlan(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveRatingPlanErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveRatingPlan(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveRatingPlanNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveRatingPlan(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveRatingProfileNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
cgrCfg.DispatcherSCfg().AttributeSConns = []string{"test"}
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveRatingProfile(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveRatingProfileErrorNil(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
CGREvent := &utils.StringWithAPIOpts{
|
|
Tenant: "tenant",
|
|
}
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveRatingProfile(CGREvent, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|
|
|
|
func TestDspReplicatorSv1RemoveRatingProfileNilEvent(t *testing.T) {
|
|
cgrCfg := config.NewDefaultCGRConfig()
|
|
dspSrv := NewDispatcherService(nil, cgrCfg, nil, nil)
|
|
var reply *string
|
|
result := dspSrv.ReplicatorSv1RemoveRatingProfile(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(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(CGREvent, reply)
|
|
expected := "MANDATORY_IE_MISSING: [ApiKey]"
|
|
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(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(nil, reply)
|
|
expected := "DISPATCHER_ERROR:NO_DATABASE_CONNECTION"
|
|
if result == nil || result.Error() != expected {
|
|
t.Errorf("\nExpected <%+v>, \nReceived <%+v>", expected, result)
|
|
}
|
|
}
|