diff options
| author | Grégoire Duchêne <gduchene@awhk.org> | 2021-07-04 17:11:11 +0100 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@awhk.org> | 2021-07-04 17:11:11 +0100 |
| commit | e59a2421c020d4b7c224750e486f40d09db52c89 (patch) | |
| tree | d342dacf03175c4c4dd24336dad2706f4af35bd6 | |
| parent | eed6373c22a0058d70d694c5e46b3fdb3d2d692d (diff) | |
Do not use deprecated fields in tests
See https://golang.org/pkg/net/http/httptest/#ResponseRecorder for more
details.
| -rw-r--r-- | pkg/twilio/filter_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/twilio/filter_test.go b/pkg/twilio/filter_test.go index 764d423..8b406fb 100644 --- a/pkg/twilio/filter_test.go +++ b/pkg/twilio/filter_test.go @@ -50,7 +50,7 @@ func TestFilter_ServeHTTP(t *testing.T) { w := httptest.NewRecorder() th.ServeHTTP(w, newRequest(Post)) assert.Equal(t, http.StatusOK, w.Code) - assert.Equal(t, "text/xml", w.HeaderMap.Get("Content-Type")) + assert.Equal(t, "text/xml", w.Result().Header.Get("Content-Type")) assert.Equal(t, "<Response/>", w.Body.String()) }) @@ -58,7 +58,7 @@ func TestFilter_ServeHTTP(t *testing.T) { w := httptest.NewRecorder() th.ServeHTTP(w, newRequest(Get)) assert.Equal(t, http.StatusOK, w.Code) - assert.Equal(t, "text/xml", w.HeaderMap.Get("Content-Type")) + assert.Equal(t, "text/xml", w.Result().Header.Get("Content-Type")) assert.Equal(t, "<Response/>", w.Body.String()) }) |
