(runtimeID string, commitID string, requestID string)
| 236 | } |
| 237 | |
| 238 | func buildRequestResponse(runtimeID string, commitID string, requestID string) (req *http.Request, resp *kunhttptest.ResponseHijacker) { |
| 239 | body := `{"key1":1,"key2":2}` |
| 240 | req = httptest.NewRequest("POST", "/status", strings.NewReader(body)) |
| 241 | req.Header.Set("x-cfc-runtimeid", runtimeID) |
| 242 | req.Header.Set("x-cfc-commitid", commitID) |
| 243 | req.Header.Set("x-cfc-hostip", "127.0.0.1") |
| 244 | q := req.URL.Query() |
| 245 | q.Add("initstart", "10") |
| 246 | q.Add("initdone", "20") |
| 247 | q.Add("concurrentmode", "false") |
| 248 | req.URL.RawQuery = q.Encode() |
| 249 | bodyString := fmt.Sprintf("{\"requestid\":\"%s\", \"success\":true}", requestID) |
| 250 | bodyBytes := []byte(bodyString) |
| 251 | resp = kunhttptest.NewResponseHijacker(bodyBytes) |
| 252 | return req, resp |
| 253 | } |
no test coverage detected