MCPcopy Create free account
hub / github.com/elimity-com/scim / TestServerResourcePutHandlerNotFound

Function TestServerResourcePutHandlerNotFound

handlers_test.go:498–517  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

496}
497
498func 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
519func TestServerResourcePutHandlerValid(t *testing.T) {
520 tests := []struct {

Callers

nothing calls this directly

Calls 5

assertEqualStatusCodeFunction · 0.85
assertUnmarshalNoErrorFunction · 0.85
assertEqualSCIMErrorsFunction · 0.85
ServeHTTPMethod · 0.80
newTestServerFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…