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

Function newTestHandlersWithResourcesAndAuth

internal/api/httpapi/helpers_test.go:542–575  ·  view source on GitHub ↗
(
	t *testing.T,
	manager core.SessionManager,
	observer core.Observer,
	resources core.ResourceService,
	auth ...gin.HandlerFunc,
)

Source from the content-addressed store, hash-verified

540}
541
542func newTestHandlersWithResourcesAndAuth(
543 t *testing.T,
544 manager core.SessionManager,
545 observer core.Observer,
546 resources core.ResourceService,
547 auth ...gin.HandlerFunc,
548) *Handlers {
549 t.Helper()
550
551 homePaths := newTestHomePaths(t)
552 cfg := testConfigWithDisabledNetwork(homePaths)
553 cfg.HTTP.Host = "127.0.0.1"
554 cfg.HTTP.Port = 2123
555
556 return newHandlers(&handlerConfig{
557 sessions: manager,
558 sessionCatalog: defaultTestSessionCatalog(manager),
559 tasks: stubTaskManager{},
560 observer: observer,
561 resources: resources,
562 workspaces: stubWorkspaceService{},
563 staticFS: mustStaticFS(t),
564 homePaths: homePaths,
565 config: cfg,
566 boundHost: cfg.HTTP.Host,
567 logger: discardLogger(),
568 startedAt: time.Date(2026, 4, 3, 12, 0, 0, 0, time.UTC),
569 now: func() time.Time { return time.Date(2026, 4, 3, 12, 0, 1, 0, time.UTC) },
570 pollInterval: 5 * time.Millisecond,
571 agentLoader: aghconfig.LoadAgentDef,
572 httpPort: cfg.HTTP.Port,
573 resourceAuth: append([]gin.HandlerFunc(nil), auth...),
574 })
575}
576
577func newTestHandlersWithSettingsAndExtensions(
578 t *testing.T,

Calls 7

mustStaticFSFunction · 0.85
appendFunction · 0.85
newTestHomePathsFunction · 0.70
newHandlersFunction · 0.70
discardLoggerFunction · 0.70

Tested by

no test coverage detected