MCPcopy Create free account
hub / github.com/buggregator/server / TestHandler_Handle_JSON

Function TestHandler_Handle_JSON

modules/sentry/handler_test.go:54–72  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestHandler_Handle_JSON(t *testing.T) {
55 h := &handler{}
56 payload := `{"event_id":"abc123","message":"test error","level":"error"}`
57 r := httptest.NewRequest("POST", "/api/myproject/store", strings.NewReader(payload))
58
59 inc, err := h.Handle(r)
60 if err != nil {
61 t.Fatal(err)
62 }
63 if inc.Type != "sentry" {
64 t.Errorf("Type = %q, want %q", inc.Type, "sentry")
65 }
66 if inc.UUID != "abc123" {
67 t.Errorf("UUID = %q, want %q", inc.UUID, "abc123")
68 }
69 if inc.Project != "myproject" {
70 t.Errorf("Project = %q, want %q", inc.Project, "myproject")
71 }
72}
73
74func TestHandler_Handle_Envelope(t *testing.T) {
75 h := &handler{}

Callers

nothing calls this directly

Calls 1

HandleMethod · 0.95

Tested by

no test coverage detected