Skip to content

Commit

Permalink
Run gofmt.
Browse files Browse the repository at this point in the history
Signed-off-by: Cyril Duez <cyril@stormz.me>
Signed-off-by: François de Metz <francois@stormz.me>
  • Loading branch information
cduez committed Jun 23, 2016
1 parent c7a3022 commit 62bcdb7
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions plugins/inputs/webhooks/mandrill/mandrill_webhooks_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package mandrill

import (
"net/url"
"github.com/influxdata/telegraf/testutil"
"net/http"
"net/http/httptest"
"net/url"
"strings"
"testing"
"github.com/influxdata/telegraf/testutil"
)

func postWebhooks(md *MandrillWebhook, eventBody string) *httptest.ResponseRecorder {
Expand Down Expand Up @@ -40,13 +40,13 @@ func TestHead(t *testing.T) {
func TestSendEvent(t *testing.T) {
var acc testutil.Accumulator
md := &MandrillWebhook{Path: "/mandrill", acc: &acc}
resp := postWebhooks(md, "["+ SendEventJSON() +"]")
resp := postWebhooks(md, "["+SendEventJSON()+"]")
if resp.Code != http.StatusOK {
t.Errorf("POST send returned HTTP status code %v.\nExpected %v", resp.Code, http.StatusOK)
}

fields := map[string]interface{}{
"id":"id1",
"id": "id1",
}

tags := map[string]string{
Expand All @@ -56,17 +56,16 @@ func TestSendEvent(t *testing.T) {
acc.AssertContainsTaggedFields(t, "mandrill_webhooks", fields, tags)
}


func TestMultipleEvents(t *testing.T) {
var acc testutil.Accumulator
md := &MandrillWebhook{Path: "/mandrill", acc: &acc}
resp := postWebhooks(md, "["+ SendEventJSON() +","+ HardBounceEventJSON() +"]")
resp := postWebhooks(md, "["+SendEventJSON()+","+HardBounceEventJSON()+"]")
if resp.Code != http.StatusOK {
t.Errorf("POST send returned HTTP status code %v.\nExpected %v", resp.Code, http.StatusOK)
}

fields := map[string]interface{}{
"id":"id1",
"id": "id1",
}

tags := map[string]string{
Expand All @@ -76,7 +75,7 @@ func TestMultipleEvents(t *testing.T) {
acc.AssertContainsTaggedFields(t, "mandrill_webhooks", fields, tags)

fields = map[string]interface{}{
"id":"id2",
"id": "id2",
}

tags = map[string]string{
Expand Down

0 comments on commit 62bcdb7

Please sign in to comment.