(t *testing.T, key, query, body string)
| 163 | } |
| 164 | |
| 165 | func postTaskPluginStatus(t *testing.T, key, query, body string) *httptest.ResponseRecorder { |
| 166 | t.Helper() |
| 167 | recorder := httptest.NewRecorder() |
| 168 | context, _ := gin.CreateTestContext(recorder) |
| 169 | context.Params = gin.Params{{Key: "key", Value: key}} |
| 170 | path := "/api/plugin/task/" + key + "/status" |
| 171 | if query != "" { |
| 172 | path += "?" + query |
| 173 | } |
| 174 | context.Request = httptest.NewRequest(http.MethodPost, path, strings.NewReader(body)) |
| 175 | context.Request.Header.Set("Content-Type", "application/json") |
| 176 | SetTaskPluginStatus(context) |
| 177 | return recorder |
| 178 | } |
| 179 | |
| 180 | func listTaskPluginItem(t *testing.T, key string) taskPluginListItem { |
| 181 | t.Helper() |
no test coverage detected