(t *testing.T)
| 114 | } |
| 115 | |
| 116 | func TestUnsupportedDecoder(t *testing.T) { |
| 117 | // Write the response produced when writing the error returned the |
| 118 | // unsupported decoder to validate the response status code. |
| 119 | w := httptest.NewRecorder() |
| 120 | decoder := &unsupportedDecoder{"application/foo"} |
| 121 | err := decoder.Decode(nil) |
| 122 | require.Error(t, err) |
| 123 | encoder := ErrorEncoder(ResponseEncoder, nil) |
| 124 | |
| 125 | err = encoder(context.Background(), w, err) |
| 126 | |
| 127 | require.NoError(t, err) |
| 128 | assert.Equal(t, http.StatusUnsupportedMediaType, w.Code) |
| 129 | } |
| 130 | |
| 131 | func TestResponseEncoder(t *testing.T) { |
| 132 | cases := []struct { |
nothing calls this directly
no test coverage detected