23 lines
513 B
Go
23 lines
513 B
Go
package postgres
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"testing"
|
|
|
|
"lincodex/backend/config"
|
|
"lincodex/backend/internal/port/outbound"
|
|
)
|
|
|
|
func TestHealthCheckerWithoutDatabaseIsNotReady(t *testing.T) {
|
|
checker, closePool, err := NewHealthChecker(context.Background(), config.Config{})
|
|
if err != nil {
|
|
t.Fatalf("NewHealthChecker() error = %v", err)
|
|
}
|
|
closePool()
|
|
|
|
if err := checker.Check(context.Background()); !errors.Is(err, outbound.ErrNotReady) {
|
|
t.Fatalf("Check() error = %v, want ErrNotReady", err)
|
|
}
|
|
}
|