(t *testing.T)
| 865 | } |
| 866 | |
| 867 | func TestScimError(t *testing.T) { |
| 868 | t.Parallel() |
| 869 | |
| 870 | // Demonstrates that we cannot use the standard errors |
| 871 | rw := httptest.NewRecorder() |
| 872 | _ = handlerutil.WriteError(rw, spec.ErrNotFound) |
| 873 | resp := rw.Result() |
| 874 | defer resp.Body.Close() |
| 875 | require.Equal(t, http.StatusInternalServerError, resp.StatusCode) |
| 876 | |
| 877 | // Our error wrapper works |
| 878 | rw = httptest.NewRecorder() |
| 879 | _ = handlerutil.WriteError(rw, scim.NewHTTPError(http.StatusNotFound, spec.ErrNotFound.Type, xerrors.New("not found"))) |
| 880 | resp = rw.Result() |
| 881 | defer resp.Body.Close() |
| 882 | require.Equal(t, http.StatusNotFound, resp.StatusCode) |
| 883 | } |
nothing calls this directly
no test coverage detected