(request *http.Request)
| 371 | } |
| 372 | |
| 373 | func SafeReadBody(request *http.Request) string { |
| 374 | if request.Body == nil { |
| 375 | return "" |
| 376 | } |
| 377 | body, err := io.ReadAll(request.Body) |
| 378 | if err != nil { |
| 379 | return "" |
| 380 | } |
| 381 | request.Body = io.NopCloser(bytes.NewBuffer(body)) |
| 382 | return string(body) |
| 383 | } |
| 384 | |
| 385 | func AssertNoPendingMocks(t *testing.T, expected int) { |
| 386 | totalPending := len(gock.Pending()) |
no outgoing calls