Files
scheduler-backend/pkg/config/config_test.go
2026-05-28 00:16:19 +08:00

22 lines
509 B
Go

package config
import "testing"
func TestMongoURI(t *testing.T) {
cfg := Config{
MongoHost: "127.0.0.1",
MongoPort: 27017,
MongoUsername: "user",
MongoPassword: "pass",
MongoAuthSource: "admin",
BusinessMongoDatabase: "openim_v3",
SchedulerMongoDatabase: "scheduler_center",
}
got := cfg.MongoURI()
want := "mongodb://user:pass@127.0.0.1:27017/?authSource=admin"
if got != want {
t.Fatalf("MongoURI() = %q, want %q", got, want)
}
}