(t *testing.T)
| 221 | } |
| 222 | |
| 223 | func 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 | |
| 244 | func TestServerResourcePatchHandlerInvalidRemoveOp(t *testing.T) { |
| 245 | req := httptest.NewRequest(http.MethodPatch, "/Groups/0001", strings.NewReader(`{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…