MCPcopy Create free account
hub / github.com/compozy/agh / TestHookRunsHandlerRejectsInvalidEvent

Function TestHookRunsHandlerRejectsInvalidEvent

internal/api/httpapi/hooks_test.go:235–256  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

233}
234
235func TestHookRunsHandlerRejectsInvalidEvent(t *testing.T) {
236 t.Parallel()
237
238 homePaths := newTestHomePaths(t)
239 manager := stubSessionManager{
240 StatusFn: func(_ context.Context, id string) (*session.Info, error) {
241 return newSessionInfo(id), nil
242 },
243 }
244
245 engine := newTestRouter(t, newTestHandlers(t, manager, stubObserver{}, homePaths))
246 recorder := performRequest(
247 t,
248 engine,
249 http.MethodGet,
250 "/api/workspaces/ws-workspace/hooks/runs?session=sess-hook&event=not-a-hook",
251 nil,
252 )
253 if recorder.Code != http.StatusBadRequest {
254 t.Fatalf("status = %d, want %d; body=%s", recorder.Code, http.StatusBadRequest, recorder.Body.String())
255 }
256}
257
258func TestHookCatalogHandlerRejectsInvalidSource(t *testing.T) {
259 t.Parallel()

Callers

nothing calls this directly

Calls 6

newTestHomePathsFunction · 0.70
newSessionInfoFunction · 0.70
newTestRouterFunction · 0.70
newTestHandlersFunction · 0.70
performRequestFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected