You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix MockPartialResponsePolicy to work with decoded response streams
The issue was that collectList() was consuming the entire decoded stream when the
decoder policy was applied before the mock policy. Changed to stream-based limiting
that works correctly whether the body is encoded or decoded. The limitStreamToBytes
method manipulates the Flux directly without collecting all buffers, properly
simulating network interruptions during streaming.
Co-authored-by: gunjansingh-msft <[email protected]>
Copy file name to clipboardExpand all lines: sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/policy/MockPartialResponsePolicy.java
+48-45Lines changed: 48 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -68,55 +68,58 @@ public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineN
68
68
returnMono.just(response);
69
69
} else {
70
70
this.tries -= 1;
71
-
// Collect the body to be able to slice it properly
0 commit comments