From 57272b498ea7f55a4cccaa1d999b55aaf0239971 Mon Sep 17 00:00:00 2001 From: Matias <83959431+mativm02@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:27:39 -0300 Subject: [PATCH] fixing TestDefaultDriver test --- pumps/mongo.go | 4 +++- pumps/mongo_aggregate.go | 4 +++- pumps/mongo_selective.go | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pumps/mongo.go b/pumps/mongo.go index 875c17f06..6169f9e05 100644 --- a/pumps/mongo.go +++ b/pumps/mongo.go @@ -353,6 +353,8 @@ func (m *MongoPump) ensureIndexes(collectionName string) error { } func (m *MongoPump) connect() { + m.dbConf.MongoDriverType = getMongoDriverType(m.dbConf.MongoDriverType) + store, err := persistent.NewPersistentStorage(&persistent.ClientOpts{ ConnectionString: m.dbConf.MongoURL, UseSSL: m.dbConf.MongoUseSSL, @@ -362,7 +364,7 @@ func (m *MongoPump) connect() { SSLPEMKeyfile: m.dbConf.MongoSSLPEMKeyfile, SessionConsistency: m.dbConf.MongoSessionConsistency, ConnectionTimeout: m.timeout, - Type: getMongoDriverType(m.dbConf.MongoDriverType), + Type: m.dbConf.MongoDriverType, DirectConnection: m.dbConf.MongoDirectConnection, }) if err != nil { diff --git a/pumps/mongo_aggregate.go b/pumps/mongo_aggregate.go index c65925b28..951040cfd 100644 --- a/pumps/mongo_aggregate.go +++ b/pumps/mongo_aggregate.go @@ -215,6 +215,8 @@ func (m *MongoAggregatePump) Init(config interface{}) error { func (m *MongoAggregatePump) connect() { var err error + m.dbConf.MongoDriverType = getMongoDriverType(m.dbConf.MongoDriverType) + m.store, err = persistent.NewPersistentStorage(&persistent.ClientOpts{ ConnectionString: m.dbConf.MongoURL, UseSSL: m.dbConf.MongoUseSSL, @@ -224,7 +226,7 @@ func (m *MongoAggregatePump) connect() { SSLPEMKeyfile: m.dbConf.MongoSSLPEMKeyfile, SessionConsistency: m.dbConf.MongoSessionConsistency, ConnectionTimeout: m.timeout, - Type: getMongoDriverType(m.dbConf.MongoDriverType), + Type: m.dbConf.MongoDriverType, DirectConnection: m.dbConf.MongoDirectConnection, }) if err != nil { diff --git a/pumps/mongo_selective.go b/pumps/mongo_selective.go index 1aa639f5d..c8380c372 100644 --- a/pumps/mongo_selective.go +++ b/pumps/mongo_selective.go @@ -113,6 +113,8 @@ func (m *MongoSelectivePump) Init(config interface{}) error { func (m *MongoSelectivePump) connect() { var err error + m.dbConf.MongoDriverType = getMongoDriverType(m.dbConf.MongoDriverType) + m.store, err = persistent.NewPersistentStorage(&persistent.ClientOpts{ ConnectionString: m.dbConf.MongoURL, UseSSL: m.dbConf.MongoUseSSL, @@ -122,7 +124,7 @@ func (m *MongoSelectivePump) connect() { SSLPEMKeyfile: m.dbConf.MongoSSLPEMKeyfile, SessionConsistency: m.dbConf.MongoSessionConsistency, ConnectionTimeout: m.timeout, - Type: getMongoDriverType(m.dbConf.MongoDriverType), + Type: m.dbConf.MongoDriverType, DirectConnection: m.dbConf.MongoDirectConnection, }) if err != nil {