(t *testing.T)
| 25 | } |
| 26 | |
| 27 | func TestServeWithHandler_error(t *testing.T) { |
| 28 | handler := func(c *echo.Context) error { |
| 29 | return echo.NewHTTPError(http.StatusBadRequest, "something went wrong") |
| 30 | } |
| 31 | testConf := ContextConfig{ |
| 32 | QueryValues: url.Values{"key": []string{"value"}}, |
| 33 | } |
| 34 | |
| 35 | customErrHandler := echo.DefaultHTTPErrorHandler(true) |
| 36 | |
| 37 | resp := testConf.ServeWithHandler(t, handler, customErrHandler) |
| 38 | |
| 39 | assert.Equal(t, http.StatusBadRequest, resp.Code) |
| 40 | assert.Equal(t, `{"message":"something went wrong"}`+"\n", resp.Body.String()) |
| 41 | } |
| 42 | |
| 43 | func TestToContext_QueryValues(t *testing.T) { |
| 44 | testConf := ContextConfig{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…