(t *testing.T)
| 183 | } |
| 184 | |
| 185 | func TestServerResourceGetHandlerNotFound(t *testing.T) { |
| 186 | req := httptest.NewRequest(http.MethodGet, "/Users/9999", nil) |
| 187 | rr := httptest.NewRecorder() |
| 188 | newTestServer().ServeHTTP(rr, req) |
| 189 | |
| 190 | assertEqualStatusCode(t, http.StatusNotFound, rr.Code) |
| 191 | |
| 192 | var scimErr *errors.ScimError |
| 193 | assertUnmarshalNoError(t, json.Unmarshal(rr.Body.Bytes(), &scimErr)) |
| 194 | expectedError := &errors.ScimError{ |
| 195 | Status: http.StatusNotFound, |
| 196 | Detail: fmt.Sprintf("Resource %d not found.", 9999), |
| 197 | } |
| 198 | assertEqualSCIMErrors(t, expectedError, scimErr) |
| 199 | } |
| 200 | |
| 201 | func TestServerResourcePatchHandlerFailOnBadType(t *testing.T) { |
| 202 | req := httptest.NewRequest(http.MethodPatch, "/Users/0001", strings.NewReader(`{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…