MCPcopy Create free account
hub / github.com/astercloud/aster / TestServer_HandleRequest_InvalidMethod

Function TestServer_HandleRequest_InvalidMethod

pkg/a2a/server_test.go:239–259  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

237}
238
239func TestServer_HandleRequest_InvalidMethod(t *testing.T) {
240 system := actor.NewSystem("test-a2a")
241 defer system.Shutdown()
242
243 taskStore := NewInMemoryTaskStore()
244 server := NewServer(system, taskStore)
245
246 req := &JSONRPCRequest{
247 JSONRPC: "2.0",
248 ID: "req-1",
249 Method: "invalid/method",
250 Params: []byte("{}"),
251 }
252
253 ctx := context.Background()
254 resp := server.HandleRequest(ctx, "agent-1", req)
255
256 require.NotNil(t, resp)
257 assert.NotNil(t, resp.Error)
258 assert.Equal(t, ErrorCodeMethodNotFound, resp.Error.Code)
259}
260
261func TestServer_HandleRequest_InvalidParams(t *testing.T) {
262 system := actor.NewSystem("test-a2a")

Callers

nothing calls this directly

Calls 5

ShutdownMethod · 0.95
HandleRequestMethod · 0.95
NewSystemFunction · 0.92
NewInMemoryTaskStoreFunction · 0.85
NewServerFunction · 0.85

Tested by

no test coverage detected