Skip to content

Commit e96b5c9

Browse files
committed
minor test refactoring
1 parent 7820e2e commit e96b5c9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

log_middleware_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ func Test_LogMiddleware_Panic(t *testing.T) {
8989

9090
assert.Contains(t, data.Error, "Test_LogMiddleware_Panic.func1")
9191
assert.Contains(t, data.Error, "some")
92-
assert.Equal(t, data.Message, "ERROR ->GET /foo")
93-
assert.Equal(t, data.Level, "error")
92+
assert.Equal(t, "ERROR ->GET /foo", data.Message)
93+
assert.Equal(t, "error", data.Level)
9494
assert.NotZero(t, data.Stack)
9595
}
9696

@@ -113,8 +113,8 @@ func Test_LogMiddleware_Panic_ErrAbortHandler(t *testing.T) {
113113

114114
data := logRecordFromBuffer(b)
115115

116-
assert.Equal(t, data.Message, "ABORTED ->GET /foo")
117-
assert.Equal(t, data.Level, "info")
116+
assert.Equal(t, "ABORTED ->GET /foo", data.Message)
117+
assert.Equal(t, "info", data.Level)
118118
}
119119

120120
func Test_LogMiddleware_Log_implicit200(t *testing.T) {
@@ -136,7 +136,7 @@ func Test_LogMiddleware_Log_implicit200(t *testing.T) {
136136
data := logRecordFromBuffer(b)
137137
a.Equal("", data.Error)
138138
a.Equal("200 ->GET /foo", data.Message)
139-
a.Equal(200, data.ResponseStatus)
139+
a.Equal(http.StatusOK, data.ResponseStatus)
140140
a.Equal("info", data.Level)
141141
}
142142

@@ -226,7 +226,7 @@ func Test_LogMiddleware_Log_404(t *testing.T) {
226226
data := logRecordFromBuffer(b)
227227
a.Equal("", data.Error)
228228
a.Equal("404 ->GET /foo", data.Message)
229-
a.Equal(404, data.ResponseStatus)
229+
a.Equal(http.StatusNotFound, data.ResponseStatus)
230230
a.Equal("warning", data.Level)
231231
}
232232

0 commit comments

Comments
 (0)