mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
fixing tests for ees
This commit is contained in:
committed by
Dan Christian Bogos
parent
16238fb3cb
commit
990feb0f26
@@ -215,6 +215,11 @@ func TestCacheJsonCfg(t *testing.T) {
|
||||
Ttl: utils.StringPointer(""), Static_ttl: utils.BoolPointer(false),
|
||||
Remote: utils.BoolPointer(false), Replicate: utils.BoolPointer(false),
|
||||
},
|
||||
utils.MetaSentryPeer: {
|
||||
Limit: utils.IntPointer(-1),
|
||||
Ttl: utils.StringPointer("24h"), Static_ttl: utils.BoolPointer(true),
|
||||
Remote: utils.BoolPointer(false), Replicate: utils.BoolPointer(false),
|
||||
},
|
||||
utils.MetaAPIBan: {Limit: utils.IntPointer(-1),
|
||||
Ttl: utils.StringPointer("2m"), Static_ttl: utils.BoolPointer(false),
|
||||
Remote: utils.BoolPointer(false), Replicate: utils.BoolPointer(false)},
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -47,9 +47,13 @@ func TestInitClient(t *testing.T) {
|
||||
ee := &ElasticEE{
|
||||
cfg: &config.EventExporterCfg{
|
||||
ExportPath: "/\x00",
|
||||
Opts: &config.EventExporterOpts{},
|
||||
},
|
||||
}
|
||||
errExpect := `cannot create client: parse "/\x00": net/url: invalid control character in URL`
|
||||
if err := ee.prepareOpts(); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
errExpect := `cannot create client: cannot parse url: parse "/\x00": net/url: invalid control character in URL`
|
||||
if err := ee.Connect(); err == nil || err.Error() != errExpect {
|
||||
t.Errorf("Expected %+v \n but got %+v", errExpect, err)
|
||||
}
|
||||
@@ -293,9 +297,10 @@ func TestElasticExportEvent3(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
eEe.eClnt.Transport = new(mockClient)
|
||||
// errExpect := `unsupported protocol scheme ""`
|
||||
errExpect := `the client noticed that the server is not Elasticsearch and we do not support this unknown product`
|
||||
|
||||
cgrCfg.EEsCfg().Exporters[0].ComputeFields()
|
||||
if err := eEe.ExportEvent(context.Background(), []byte{}, ""); err != nil {
|
||||
if err := eEe.ExportEvent(context.Background(), []byte{}, ""); err == nil || err.Error() != errExpect {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ var (
|
||||
|
||||
extraDBPartition = NewStringSet([]string{CacheDispatchers,
|
||||
CacheDispatcherRoutes, CacheDispatcherLoads, CacheDiameterMessages, CacheRPCResponses, CacheClosedSessions,
|
||||
CacheCDRIDs, CacheRPCConnections, CacheUCH, CacheSTIR, CacheEventCharges, MetaAPIBan,
|
||||
CacheCDRIDs, CacheRPCConnections, CacheUCH, CacheSTIR, CacheEventCharges, MetaAPIBan, MetaSentryPeer,
|
||||
CacheCapsEvents, CacheReplicationHosts})
|
||||
|
||||
DataDBPartitions = NewStringSet([]string{
|
||||
|
||||
Reference in New Issue
Block a user