MCPcopy Create free account
hub / github.com/goadesign/goa / executeWebSocket

Method executeWebSocket

jsonrpc/integration_tests/framework/executor.go:173–199  ·  view source on GitHub ↗

executeWebSocket handles WebSocket transport scenarios

(ctx context.Context, t *testing.T, scenario Scenario)

Source from the content-addressed store, hash-verified

171
172// executeWebSocket handles WebSocket transport scenarios
173func (e *executor) executeWebSocket(ctx context.Context, t *testing.T, scenario Scenario) {
174 t.Helper()
175
176 // WebSocket scenarios always use sequence
177 if len(scenario.Sequence) > 0 {
178 e.executeWebSocketSequence(ctx, t, scenario)
179 return
180 }
181
182 // If no sequence, create a simple send/receive sequence from request/expect
183 if scenario.Request.Params != nil {
184 // Pass method, params, and id as separate fields
185 data := map[string]any{
186 "method": scenario.Method,
187 "params": scenario.Request.Params,
188 }
189 if scenario.Request.ID != nil {
190 data["id"] = scenario.Request.ID
191 }
192
193 scenario.Sequence = []Action{
194 {Type: "send", Data: data},
195 {Type: "receive", Expect: scenario.Expect},
196 }
197 e.executeWebSocketSequence(ctx, t, scenario)
198 }
199}
200
201// executeSSE handles Server-Sent Events scenarios
202func (e *executor) executeSSE(_ context.Context, t *testing.T, _ Scenario) {

Callers 1

executeSimpleMethod · 0.95

Calls 1

Tested by

no test coverage detected