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

Function TestServerResourceGetHandlerNotFound

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

Source from the content-addressed store, hash-verified

183}
184
185func 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
201func TestServerResourcePatchHandlerFailOnBadType(t *testing.T) {
202 req := httptest.NewRequest(http.MethodPatch, "/Users/0001", strings.NewReader(`{

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…