Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
test: fix error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Jan 13, 2020
1 parent 08ba9bc commit 439d4de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions terraform/graylog/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ func (tc *testCase) genTestBody(exp map[string]interface{}, bodyString string, s
return func(t *testing.T, req *http.Request, svc *flute.Service, route *flute.Route) {
if tc.ConvertReqBody != nil {
data, err := tc.ConvertReqBody(req.Body)
require.Nil(t, err)
assert.Equal(t, exp, data)
require.Nil(t, err, "failed to convert a request body; route: "+route.Name)
assert.Equal(t, exp, data, "request body should match; route: "+route.Name)
} else {
body := map[string]interface{}{}
require.Nil(t, json.NewDecoder(req.Body).Decode(&body))
assert.Equal(t, exp, body)
require.Nil(t, json.NewDecoder(req.Body).Decode(&body), "failed to unmarshal request body as JSON; route: "+route.Name)
assert.Equal(t, exp, body, "request body should match; route: "+route.Name)
}
store.Set(bodyString)
}
Expand Down

0 comments on commit 439d4de

Please sign in to comment.