From 916f9e9050d67b3f6ca97c245821d51150b8798c Mon Sep 17 00:00:00 2001 From: Russ Savage Date: Thu, 10 Oct 2019 17:39:35 -0700 Subject: [PATCH] updating tests --- plugins/inputs/webhooks/plex/plex_webhooks_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/inputs/webhooks/plex/plex_webhooks_test.go b/plugins/inputs/webhooks/plex/plex_webhooks_test.go index 7c0730a9..b60ab870 100644 --- a/plugins/inputs/webhooks/plex/plex_webhooks_test.go +++ b/plugins/inputs/webhooks/plex/plex_webhooks_test.go @@ -10,6 +10,7 @@ import ( "testing" "github.com/influxdata/telegraf/testutil" + "github.com/stretchr/testify/require" ) func PlexWebhookRequest(jsonString string, t *testing.T) { @@ -23,9 +24,7 @@ func PlexWebhookRequest(jsonString string, t *testing.T) { req.Header.Set("Content-Type", writer.FormDataContentType()) w := httptest.NewRecorder() p.eventHandler(w, req) - if w.Code != http.StatusOK { - t.Errorf("POST returned HTTP status code %v.\nExpected %v", w.Code, http.StatusOK) - } + require.Equal(t, http.StatusOK, w.Code) } func TestPlexEvent(t *testing.T) {