Skip to content

Commit

Permalink
Update mongo_scaler_test.go
Browse files Browse the repository at this point in the history
Signed-off-by: rickbrouwer <[email protected]>
  • Loading branch information
rickbrouwer committed Oct 23, 2024
1 parent 58365d8 commit 13e6e5b
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions pkg/scalers/mongo_scaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
}
}

Expand All @@ -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)
}
}
}
Expand Down

0 comments on commit 13e6e5b

Please sign in to comment.