(t *testing.T, payload map[string]any)
| 1463 | } |
| 1464 | |
| 1465 | func postTaskPluginUpload(t *testing.T, payload map[string]any) *httptest.ResponseRecorder { |
| 1466 | t.Helper() |
| 1467 | body, err := common.Marshal(payload) |
| 1468 | require.NoError(t, err) |
| 1469 | recorder := httptest.NewRecorder() |
| 1470 | context, _ := gin.CreateTestContext(recorder) |
| 1471 | context.Request = httptest.NewRequest(http.MethodPost, "/api/plugin/task", strings.NewReader(string(body))) |
| 1472 | context.Request.Header.Set("Content-Type", "application/json") |
| 1473 | UploadTaskPlugin(context) |
| 1474 | return recorder |
| 1475 | } |
| 1476 | |
| 1477 | func deleteTaskPluginVersionRequest(t *testing.T, key, version string) *httptest.ResponseRecorder { |
| 1478 | t.Helper() |
no test coverage detected