From 13e6e5b1b0fffb68ee4d68d12c0bcb035fa943dd Mon Sep 17 00:00:00 2001 From: rickbrouwer Date: Wed, 23 Oct 2024 07:19:32 +0200 Subject: [PATCH] Update mongo_scaler_test.go Signed-off-by: rickbrouwer --- pkg/scalers/mongo_scaler_test.go | 37 -------------------------------- 1 file changed, 37 deletions(-) diff --git a/pkg/scalers/mongo_scaler_test.go b/pkg/scalers/mongo_scaler_test.go index 25186fbc2e0..ef27ff0e632 100644 --- a/pkg/scalers/mongo_scaler_test.go +++ b/pkg/scalers/mongo_scaler_test.go @@ -109,15 +109,6 @@ func TestParseMongoDBMetadata(t *testing.T) { if err == nil && testData.raisesError { t.Error("Expected error but got success") } - if err == nil { - err = meta.Validate() - if err != nil && !testData.raisesError { - t.Error("Expected success but got error:", err) - } - if err == nil && testData.raisesError { - t.Error("Expected error but got success") - } - } } } @@ -130,34 +121,6 @@ func TestParseMongoDBConnectionString(t *testing.T) { }) if err != nil { t.Error("Expected success but got error:", err) - continue - } - - var connString string - if meta.ConnectionString != "" { - connString = meta.ConnectionString - } else { - if meta.Scheme == "mongodb+srv" { - u := &url.URL{ - Scheme: meta.Scheme, - User: url.UserPassword(meta.Username, meta.Password), - Host: meta.Host, - Path: meta.DBName, - } - connString = u.String() - } else { - u := &url.URL{ - Scheme: meta.Scheme, - User: url.UserPassword(meta.Username, meta.Password), - Host: net.JoinHostPort(meta.Host, meta.Port), - Path: meta.DBName, - } - connString = u.String() - } - } - - if connString != testData.connectionString { - t.Errorf("Expected connection string %s but got %s", testData.connectionString, connString) } } }