(t *testing.T)
| 38 | } |
| 39 | |
| 40 | func TestSQLiteStore_Store_and_FindByUUID(t *testing.T) { |
| 41 | db := setupTestDB(t) |
| 42 | store := storage.NewSQLiteStore(db) |
| 43 | ctx := context.Background() |
| 44 | |
| 45 | ev := makeEvent("uuid-1", "sentry", "default") |
| 46 | if err := store.Store(ctx, ev); err != nil { |
| 47 | t.Fatalf("Store: %v", err) |
| 48 | } |
| 49 | |
| 50 | found, err := store.FindByUUID(ctx, "uuid-1") |
| 51 | if err != nil { |
| 52 | t.Fatalf("FindByUUID: %v", err) |
| 53 | } |
| 54 | if found == nil { |
| 55 | t.Fatal("expected event, got nil") |
| 56 | } |
| 57 | if found.UUID != "uuid-1" { |
| 58 | t.Errorf("UUID = %q, want %q", found.UUID, "uuid-1") |
| 59 | } |
| 60 | if found.Type != "sentry" { |
| 61 | t.Errorf("Type = %q, want %q", found.Type, "sentry") |
| 62 | } |
| 63 | if found.Project != "default" { |
| 64 | t.Errorf("Project = %q, want %q", found.Project, "default") |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | func TestSQLiteStore_FindByUUID_NotFound(t *testing.T) { |
| 69 | db := setupTestDB(t) |
nothing calls this directly
no test coverage detected