From e59a2421c020d4b7c224750e486f40d09db52c89 Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sun, 4 Jul 2021 17:11:11 +0100 Subject: Do not use deprecated fields in tests See https://golang.org/pkg/net/http/httptest/#ResponseRecorder for more details. --- pkg/twilio/filter_test.go | 4 ++-- 1 file 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, "", 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, "", w.Body.String()) }) -- cgit v1.2.3-70-g09d2