mobility-accounts/storage/postgresql_test.go

22 lines
531 B
Go
Raw Normal View History

2023-04-25 12:14:42 +00:00
package storage
import (
"github.com/spf13/viper"
"testing"
)
func TestNewPostgresqlStorage(t *testing.T) {
cfg := viper.New()
cfg.Set("storage.db.psql.host", "localhost")
cfg.Set("storage.db.psql.port", "5432")
cfg.Set("storage.db.psql.user", "postgres")
cfg.Set("storage.db.psql.password", "postgres")
cfg.Set("storage.db.psql.dbname", "mobilityaccounts")
storage, err := NewPostgresqlStorage(cfg)
if err != nil {
t.Errorf("error creating new PostgreSQL storage: %v", err)
}
defer storage.DbConnection.Close()
}