(t *testing.T)
| 496 | } |
| 497 | |
| 498 | func TestServerResourcePutHandlerNotFound(t *testing.T) { |
| 499 | req := httptest.NewRequest(http.MethodPut, "/Users/9999", strings.NewReader(`{"userName": "other"}`)) |
| 500 | rr := httptest.NewRecorder() |
| 501 | newTestServer().ServeHTTP(rr, req) |
| 502 | |
| 503 | assertEqualStatusCode(t, http.StatusNotFound, rr.Code) |
| 504 | |
| 505 | var scimErr *errors.ScimError |
| 506 | assertUnmarshalNoError(t, json.Unmarshal(rr.Body.Bytes(), &scimErr)) |
| 507 | expectedError := &errors.ScimError{ |
| 508 | Status: http.StatusNotFound, |
| 509 | Detail: fmt.Sprintf("Resource %d not found.", 9999), |
| 510 | } |
| 511 | assertEqualSCIMErrors(t, expectedError, scimErr) |
| 512 | |
| 513 | if scimErr == nil || scimErr.Status != http.StatusNotFound || |
| 514 | scimErr.Detail != fmt.Sprintf("Resource %d not found.", 9999) { |
| 515 | t.Errorf("wrong scim error: %v", scimErr) |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | func TestServerResourcePutHandlerValid(t *testing.T) { |
| 520 | tests := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…