Commit dc45304
committed
Fixed test and fixed a bug
The test UploadResponseHandlerTest#getUploadSessionOnProgressingUpload mimicked a server response with a 200/OK response code.
In the REST reference (https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0#upload-bytes-to-the-upload-session) it is stated that the response code for uploading more bytes to the upload session is 202/Accepted.
The bug in #1517 is fixed.
Previously the method UploadResponseHandler#handleResponse handled differently the response in these two cases:
- response code 200/OK
- all other cases
Now the same method handles differently the response in these two cases:
- response code 200/OK or 201/Created
- all other cases
Everything works if the REST reference is corrected and:
- 200/OK is returned when an item is updated, 201/Created is returned when an item is Created
- 202/Accepted is returned when more bytes are requested1 parent 2c168c7 commit dc45304
File tree
2 files changed
+6
-5
lines changed- src
- main/java/com/microsoft/graph/core/requests/upload
- test/java/com/microsoft/graph/core/requests/upload
2 files changed
+6
-5
lines changedLines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | | - | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
0 commit comments