Skip to content

Commit bc6b026

Browse files
authored
Update TextProxyPlaybackClient to propagate Context (#47536)
1 parent 4e0de66 commit bc6b026

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

sdk/core/azure-core-test/src/main/java/com/azure/core/test/http/TestProxyPlaybackClient.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,18 @@ private boolean isPlayingBack() {
284284
public String getRecordingFileLocation() {
285285
return xRecordingFileLocation;
286286
}
287+
288+
/**
289+
* Redirects the provided {@link HttpRequest} to the test proxy to retrieve the playback response.
290+
* This method is invoked during playback mode to simulate the expected response for a request.
291+
*
292+
* @param request The {@link HttpRequest} to be sent.
293+
* @param context The {@link Context} associated with the operation.
294+
* @return A {@link Mono} of {@link HttpResponse} containing the playback response.
295+
*/
296+
@Override
297+
public Mono<HttpResponse> send(HttpRequest request, Context context) {
298+
beforeSendingRequest(request);
299+
return client.send(request, context).map(this::afterReceivedResponse);
300+
}
287301
}

0 commit comments

Comments
 (0)