(engine *gin.Engine, method, url string, body any, response any)
| 42 | } |
| 43 | |
| 44 | func 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 | } |
no outgoing calls
no test coverage detected