(t *testing.T, key, query, body string)
| 133 | } |
| 134 | |
| 135 | func postTaskPluginStatus(t *testing.T, key, query, body string) *httptest.ResponseRecorder { |
| 136 | t.Helper() |
| 137 | recorder := httptest.NewRecorder() |
| 138 | context, _ := gin.CreateTestContext(recorder) |
| 139 | context.Params = gin.Params{{Key: "key", Value: key}} |
| 140 | path := "/api/plugin/task/" + key + "/status" |
| 141 | if query != "" { |
| 142 | path += "?" + query |
| 143 | } |
| 144 | context.Request = httptest.NewRequest(http.MethodPost, path, strings.NewReader(body)) |
| 145 | context.Request.Header.Set("Content-Type", "application/json") |
| 146 | SetTaskPluginStatus(context) |
| 147 | return recorder |
| 148 | } |
| 149 | |
| 150 | func listTaskPluginItem(t *testing.T, key string) taskPluginListItem { |
| 151 | t.Helper() |
no test coverage detected