Verb specific test functions AssertGetResponse requests a URI with GET and expects a status code and body text.
(requestURI string, expectedStatusCode int, expectedBody string)
| 543 | |
| 544 | // AssertGetResponse requests a URI with GET and expects a status code and body text. |
| 545 | func (tc *Tester) AssertGetResponse(requestURI string, expectedStatusCode int, expectedBody string) (*http.Response, string) { |
| 546 | tc.t.Helper() |
| 547 | |
| 548 | req, err := http.NewRequest("GET", requestURI, nil) |
| 549 | if err != nil { |
| 550 | tc.t.Fatalf("unable to create request %s", err) |
| 551 | } |
| 552 | |
| 553 | return tc.AssertResponse(req, expectedStatusCode, expectedBody) |
| 554 | } |
| 555 | |
| 556 | // AssertDeleteResponse requests a URI with DELETE and expects a status code and body text. |
| 557 | func (tc *Tester) AssertDeleteResponse(requestURI string, expectedStatusCode int, expectedBody string) (*http.Response, string) { |