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

Function TestServerResourcePatchHandlerInvalidPath

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

Source from the content-addressed store, hash-verified

221}
222
223func TestServerResourcePatchHandlerInvalidPath(t *testing.T) {
224 req := httptest.NewRequest(http.MethodPatch, "/Users/0001", strings.NewReader(`{
225 "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
226 "Operations":[
227 {
228 "op":"replace",
229 "path":"name.invalid",
230 "value":"test"
231 }
232 ]
233 }`))
234 rr := httptest.NewRecorder()
235 newTestServer().ServeHTTP(rr, req)
236
237 assertEqualStatusCode(t, http.StatusBadRequest, rr.Code)
238
239 var scimErr *errors.ScimError
240 assertUnmarshalNoError(t, json.Unmarshal(rr.Body.Bytes(), &scimErr))
241 assertEqualSCIMErrors(t, &errors.ScimErrorInvalidPath, scimErr)
242}
243
244func TestServerResourcePatchHandlerInvalidRemoveOp(t *testing.T) {
245 req := httptest.NewRequest(http.MethodPatch, "/Groups/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…