| 52 | } |
| 53 | |
| 54 | func verifySuccess(t *testing.T, e log.Entry) { |
| 55 | a := assertions.New(t) |
| 56 | a.So(e.Level(), should.Equal, log.InfoLevel) |
| 57 | a.So(e.Message(), should.Equal, "Request handled") |
| 58 | fields := e.Fields().Fields() |
| 59 | for _, key := range []string{"http.method", "http.path", "peer.address", "request_id", "http.status", "duration"} { |
| 60 | a.So(fields, should.ContainKey, key) |
| 61 | } |
| 62 | a.So(fields["http.method"], should.Equal, http.MethodGet) |
| 63 | a.So(fields["http.path"], should.Equal, "/") |
| 64 | a.So(fields["http.status"], should.Equal, http.StatusOK) |
| 65 | } |
| 66 | |
| 67 | func verifyClientError(t *testing.T, e log.Entry) { |
| 68 | a := assertions.New(t) |