@@ -151,34 +151,37 @@ private class DefaultUriSpec<S extends RequestHeadersSpec<?>> implements UriSpec
151
151
152
152
@ Override
153
153
public S uri (URI uri ) {
154
- return (S ) new DefaultRequestBodySpec (this .uriSpec .uri (uri ));
154
+ return (S ) new DefaultRequestBodySpec (this .uriSpec .uri (uri ), null );
155
155
}
156
156
157
157
@ Override
158
158
public S uri (String uriTemplate , Object ... uriVariables ) {
159
- return (S ) new DefaultRequestBodySpec (this .uriSpec .uri (uriTemplate , uriVariables ));
159
+ return (S ) new DefaultRequestBodySpec (this .uriSpec .uri (uriTemplate , uriVariables ), uriTemplate );
160
160
}
161
161
162
162
@ Override
163
163
public S uri (String uriTemplate , Map <String , ?> uriVariables ) {
164
- return (S ) new DefaultRequestBodySpec (this .uriSpec .uri (uriTemplate , uriVariables ));
164
+ return (S ) new DefaultRequestBodySpec (this .uriSpec .uri (uriTemplate , uriVariables ), uriTemplate );
165
165
}
166
166
167
167
@ Override
168
168
public S uri (Function <UriBuilder , URI > uriBuilder ) {
169
- return (S ) new DefaultRequestBodySpec (this .uriSpec .uri (uriBuilder ));
169
+ return (S ) new DefaultRequestBodySpec (this .uriSpec .uri (uriBuilder ), null );
170
170
}
171
171
}
172
172
173
173
private class DefaultRequestBodySpec implements RequestBodySpec {
174
174
175
175
private final WebClient .RequestBodySpec bodySpec ;
176
176
177
+ private final String uriTemplate ;
178
+
177
179
private final String requestId ;
178
180
179
181
180
- DefaultRequestBodySpec (WebClient .RequestBodySpec spec ) {
182
+ DefaultRequestBodySpec (WebClient .RequestBodySpec spec , String uriTemplate ) {
181
183
this .bodySpec = spec ;
184
+ this .uriTemplate = uriTemplate ;
182
185
this .requestId = String .valueOf (requestIndex .incrementAndGet ());
183
186
this .bodySpec .header (WebTestClient .WEBTESTCLIENT_REQUEST_ID , this .requestId );
184
187
}
@@ -270,7 +273,7 @@ public RequestHeadersSpec<?> syncBody(Object body) {
270
273
private DefaultResponseSpec toResponseSpec (Mono <ClientResponse > mono ) {
271
274
ClientResponse clientResponse = mono .block (getTimeout ());
272
275
ExchangeResult exchangeResult = wiretapConnector .claimRequest (this .requestId );
273
- return new DefaultResponseSpec (exchangeResult , clientResponse , getTimeout ());
276
+ return new DefaultResponseSpec (exchangeResult , clientResponse , this . uriTemplate , getTimeout ());
274
277
}
275
278
276
279
}
@@ -283,8 +286,10 @@ private static class UndecodedExchangeResult extends ExchangeResult {
283
286
private final Duration timeout ;
284
287
285
288
286
- UndecodedExchangeResult (ExchangeResult result , ClientResponse response , Duration timeout ) {
287
- super (result );
289
+ UndecodedExchangeResult (ExchangeResult result , ClientResponse response ,
290
+ String uriTemplate , Duration timeout ) {
291
+
292
+ super (result , uriTemplate );
288
293
this .response = response ;
289
294
this .timeout = timeout ;
290
295
}
@@ -321,8 +326,8 @@ private static class DefaultResponseSpec implements ResponseSpec {
321
326
private final UndecodedExchangeResult result ;
322
327
323
328
324
- DefaultResponseSpec (ExchangeResult result , ClientResponse response , Duration timeout ) {
325
- this .result = new UndecodedExchangeResult (result , response , timeout );
329
+ DefaultResponseSpec (ExchangeResult result , ClientResponse response , String uriTemplate , Duration timeout ) {
330
+ this .result = new UndecodedExchangeResult (result , response , uriTemplate , timeout );
326
331
}
327
332
328
333
@ Override
0 commit comments