MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / call

Method call

internal/e2e/smoke_test.go:500–516  ·  view source on GitHub ↗

call sends one JSON-RPC request and returns the `result` object.

(t *testing.T, method string, params any)

Source from the content-addressed store, hash-verified

498
499// call sends one JSON-RPC request and returns the `result` object.
500func (m *mcpProc) call(t *testing.T, method string, params any) map[string]any {
501 t.Helper()
502 m.nextID++
503 req := map[string]any{"jsonrpc": "2.0", "id": m.nextID, "method": method}
504 if params != nil {
505 req["params"] = params
506 }
507 require.NoError(t, m.stdin.Encode(req))
508 require.True(t, m.stdout.Scan(), "mcp server closed stdout (scan err: %v)", m.stdout.Err())
509 var resp struct {
510 Result map[string]any `json:"result"`
511 Error any `json:"error"`
512 }
513 require.NoError(t, json.Unmarshal(m.stdout.Bytes(), &resp))
514 require.Nil(t, resp.Error, "jsonrpc error for %s", method)
515 return resp.Result
516}
517
518// notify sends a JSON-RPC notification (no response expected).
519func (m *mcpProc) notify(t *testing.T, method string) {

Callers 4

toolCallMethod · 0.95
TestFGADisabledFunction · 0.80
TestReleaseSmokeFunction · 0.80
getObjectDiffFunction · 0.80

Calls 1

ScanMethod · 0.80

Tested by

no test coverage detected