(t *testing.T)
| 16 | ) |
| 17 | |
| 18 | func setupLedgerForge(t *testing.T) (*ledgerforge.LedgerForge, error) { |
| 19 | t.Helper() |
| 20 | |
| 21 | if testing.Short() { |
| 22 | t.Skip("skipping middleware integration tests in short mode") |
| 23 | } |
| 24 | |
| 25 | config.MockConfig(&config.Configuration{ |
| 26 | Redis: config.RedisConfig{Dns: "localhost:6379"}, |
| 27 | DataSource: config.DataSourceConfig{Dns: "postgres://postgres:@localhost:5432/ledgerforge?sslmode=disable"}, |
| 28 | }) |
| 29 | cnf, err := config.Fetch() |
| 30 | if err != nil { |
| 31 | return nil, err |
| 32 | } |
| 33 | db, err := database.NewDataSource(cnf) |
| 34 | if err != nil { |
| 35 | return nil, err |
| 36 | } |
| 37 | |
| 38 | return ledgerforge.NewLedgerForge(db) |
| 39 | } |
| 40 | |
| 41 | func TestAuthMiddleware_Authenticate(t *testing.T) { |
| 42 | gin.SetMode(gin.TestMode) |
no test coverage detected