MCPcopy Create free account
hub / github.com/asternic/wuzapi / toJSON

Method toJSON

stdio_test.go:340–356  ·  view source on GitHub ↗

toJSON converts the request to a JSON string

(t *testing.T)

Source from the content-addressed store, hash-verified

338
339// toJSON converts the request to a JSON string
340func (r *testRequest) toJSON(t *testing.T) string {
341 t.Helper()
342
343 reqData := map[string]interface{}{
344 "id": r.ID,
345 "method": r.Method,
346 }
347 if r.Params != nil {
348 reqData["params"] = r.Params
349 }
350
351 jsonBytes, err := json.Marshal(reqData)
352 if err != nil {
353 t.Fatalf("Failed to marshal request: %v", err)
354 }
355 return string(jsonBytes)
356}
357
358// executeRequest is a helper that sends a JSON-RPC request and returns the parsed response
359func executeRequest(t *testing.T, s *server, request string) map[string]interface{} {

Callers 15

TestStdioHealthRequestFunction · 0.80
TestAdminUsersAddAndListFunction · 0.80
TestAdminUsersGetFunction · 0.80
TestAdminUsersDeleteFunction · 0.80
TestSessionStatusFunction · 0.80
TestChatSendTextFunction · 0.80
TestChatHistoryFunction · 0.80
TestWebhookUpdateFunction · 0.80
TestWebhookSetFunction · 0.80
TestWebhookDeleteFunction · 0.80
TestNumericRequestIDFunction · 0.80
TestNumericZeroRequestIDFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected