MCPcopy Index your code
hub / github.com/docker/docker-agent / TestA2AServer_Invoke

Function TestA2AServer_Invoke

e2e/a2a_test.go:70–88  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

68}
69
70func TestA2AServer_Invoke(t *testing.T) {
71 t.Parallel()
72
73 _, runConfig := startRecordingAIProxy(t)
74 agentCard := startA2AServer(t, "testdata/basic.yaml", runConfig)
75
76 resp := sendA2AMessage(t, agentCard.URL, "test-request-1", "msg-1", "What is 2+2? Answer with just the number.")
77
78 assert.Equal(t, "2.0", resp.Jsonrpc)
79 assert.Equal(t, "test-request-1", resp.ID)
80 assert.Nil(t, resp.Error)
81 require.NotNil(t, resp.Result)
82
83 texts := resp.textParts()
84 require.NotEmpty(t, texts)
85 for _, text := range texts {
86 assert.Equal(t, "4", text)
87 }
88}
89
90func TestA2AServer_MultipleRequests(t *testing.T) {
91 t.Parallel()

Callers

nothing calls this directly

Calls 4

startRecordingAIProxyFunction · 0.85
startA2AServerFunction · 0.85
sendA2AMessageFunction · 0.85
textPartsMethod · 0.80

Tested by

no test coverage detected