mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 08:38:45 +05:00
Revise/add unit tests after sentrypeer addition
This commit is contained in:
committed by
Dan Christian Bogos
parent
20afc011fb
commit
e5b7b91799
@@ -61,14 +61,12 @@ func TestAPIBanCfgAsMapInterface(t *testing.T) {
|
||||
var alS APIBanCfg
|
||||
cfgJSONStr := `{
|
||||
"apiban":{
|
||||
"enabled":false,
|
||||
"keys": ["key1","key2"]
|
||||
},
|
||||
|
||||
}`
|
||||
eMap := map[string]any{
|
||||
"enabled": false,
|
||||
"keys": []string{"key1", "key2"},
|
||||
"keys": []string{"key1", "key2"},
|
||||
}
|
||||
if jsnCfg, err := NewCgrJsonCfgFromBytes([]byte(cfgJSONStr)); err != nil {
|
||||
t.Error(err)
|
||||
|
||||
@@ -1264,9 +1264,9 @@ const CGRATES_CFG_JSON = `
|
||||
|
||||
|
||||
"apiban": {
|
||||
"enabled": false,
|
||||
"keys": [],
|
||||
},
|
||||
|
||||
"sentrypeer":{
|
||||
"client_id":"",
|
||||
"client_secret":"",
|
||||
|
||||
@@ -223,6 +223,9 @@ func TestCacheJsonCfg(t *testing.T) {
|
||||
utils.MetaAPIBan: {Limit: utils.IntPointer(-1),
|
||||
Ttl: utils.StringPointer("2m"), Static_ttl: utils.BoolPointer(false),
|
||||
Remote: utils.BoolPointer(false), Replicate: utils.BoolPointer(false)},
|
||||
utils.MetaSentryPeer: {Limit: utils.IntPointer(-1),
|
||||
Ttl: utils.StringPointer("86400s"), Static_ttl: utils.BoolPointer(true),
|
||||
Remote: utils.BoolPointer(false), Replicate: utils.BoolPointer(false)},
|
||||
utils.CacheReplicationHosts: {Limit: utils.IntPointer(0),
|
||||
Ttl: utils.StringPointer(""), Static_ttl: utils.BoolPointer(false),
|
||||
Remote: utils.BoolPointer(false), Replicate: utils.BoolPointer(false)},
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1005,7 +1005,7 @@ func TestNewAttrReloadCacheWithOpts(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNewAttrReloadCacheWithOptsFromMap(t *testing.T) {
|
||||
excluded := NewStringSet([]string{MetaAPIBan, MetaAccounts, MetaLoadIDs})
|
||||
excluded := NewStringSet([]string{MetaAPIBan, MetaSentryPeer, MetaAccounts, MetaLoadIDs})
|
||||
mp := make(map[string][]string)
|
||||
for k := range CacheInstanceToPrefix {
|
||||
if !excluded.Has(k) {
|
||||
|
||||
Reference in New Issue
Block a user