MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / verifySuccess

Function verifySuccess

pkg/webmiddleware/log_test.go:54–65  ·  view source on GitHub ↗
(t *testing.T, e log.Entry)

Source from the content-addressed store, hash-verified

52}
53
54func 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
67func verifyClientError(t *testing.T, e log.Entry) {
68 a := assertions.New(t)

Callers 1

TestLogFunction · 0.85

Calls 4

NewMethod · 0.65
LevelMethod · 0.65
MessageMethod · 0.65
FieldsMethod · 0.65

Tested by

no test coverage detected