MCPcopy Create free account
hub / github.com/NextDotID/proof_server / APITestCall

Function APITestCall

controller/main_test.go:44–52  ·  view source on GitHub ↗
(engine *gin.Engine, method, url string, body any, response any)

Source from the content-addressed store, hash-verified

42}
43
44func APITestCall(engine *gin.Engine, method, url string, body any, response any) *httptest.ResponseRecorder {
45 body_bytes, _ := json.Marshal(body)
46 w := httptest.NewRecorder()
47 req, _ := http.NewRequest(method, url, bytes.NewReader(body_bytes))
48 engine.ServeHTTP(w, req)
49
50 json.Unmarshal(w.Body.Bytes(), response)
51 return w
52}

Callers 5

Test_proofPayloadFunction · 0.70
Test_ProofUploadFunction · 0.70
Test_proofExistsFunction · 0.70
Test_proofChainQueryFunction · 0.70
Test_proofQueryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected