(t *testing.T)
| 36 | } |
| 37 | |
| 38 | func TestDefaultErrorBadRequest(t *testing.T) { |
| 39 | mode.Set(mode.TestDev) |
| 40 | rec := httptest.NewRecorder() |
| 41 | ctx, _ := gin.CreateTestContext(rec) |
| 42 | ctx.AbortWithError(400, errors.New("you need todo something")) |
| 43 | |
| 44 | Handler()(ctx) |
| 45 | |
| 46 | assertJSONResponse(t, rec, 400, `{"errorCode":400, "errorDescription":"you need todo something", "error":"Bad Request"}`) |
| 47 | } |
| 48 | |
| 49 | type testValidate struct { |
| 50 | Username string `json:"username" binding:"required"` |
nothing calls this directly
no test coverage detected
searching dependent graphs…