SharePoint Graph Module - extend functionality with additional methods#8318
SharePoint Graph Module - extend functionality with additional methods#8318Drakonian wants to merge 4 commits into
Conversation
|
Issue #8317 is not valid. Please make sure you link an issue that exists, is open and is approved. |
No newline at end of fileThe file ends without a trailing newline (the diff shows the last added line without the standard Unix EOF newline). While AL compilation typically tolerates this, it causes noise in future diffs and violates standard file conventions in the repository. Recommendation:
Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
| MockHttpClientHandler.ExpectSendToFailWithError(ErrorText); | ||
| end; | ||
|
|
||
| procedure AddMockResponse(StatusCode: Integer; ResponseBody: Text) |
There was a problem hiding this comment.
I know that this is only a test codeunit, but should we maybe document the current logic?
What I mean is that we should maybe make it clear that you shoud either use SetResponse once or AddResponse multiple times.
What & why
The SharePoint Graph module currently supports creating files, folders, and list items — but offers no way to modify them after creation. Renaming an uploaded file or updating metadata on a list item are among the most common SharePoint integration scenarios, and their absence forces consumers to drop down to raw HTTP calls.
This PR closes that gap by adding update operations for both drive items and list items, backed by the standard MS Graph PATCH endpoints. It also upgrades the test infrastructure to properly cover multi-step operations that were previously untestable.
Linked work
Fixes #8317
How I validated this
UpdateDriveItemandRenameDriveItemagainst a test SharePoint site — file renamed successfully, response parsed intoSharePoint Graph Drive Itemrecord with updated name.UpdateListItemwith a fields payload (Title, custom columns) — PATCH succeeded, follow-up GET returned the full list item with updated values.GetListItemfor a single item — returned the expected record with all fields (ContentType, WebUrl, timestamps).RenameDriveItemByPathandUpdateDriveItemByPath— path resolution + PATCH executed as two consecutive HTTP calls, both reflected in mock request log.UpdateListItem_FollowUpGetFailstest — when the GET after PATCH returns 404, the error is surfaced to the caller and request count is 2 (PATCH did fire).Risk & compatibility