Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2dcd56b

Browse files
committed
Polishing contribution
Closes gh-36514
1 parent 00be6d3 commit 2dcd56b

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

spring-web/src/test/java/org/springframework/web/client/support/RestClientAdapterTests.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ void greetingWithApiVersion() throws Exception {
200200
assertThat(actualResponse).isEqualTo("Hello Spring 2!");
201201
}
202202

203-
@Test
203+
@Test // gh-36514
204204
void greetingWithDefaultApiVersion() throws Exception {
205205
prepareResponse(builder ->
206206
builder.setHeader("Content-Type", "text/plain").body("Hello Spring 2!"));
@@ -211,10 +211,9 @@ void greetingWithDefaultApiVersion() throws Exception {
211211
.apiVersionInserter(ApiVersionInserter.useHeader("X-Version"))
212212
.build();
213213

214-
RestClientAdapter adapter = RestClientAdapter.create(restClient);
215-
Service service = HttpServiceProxyFactory.builderFor(adapter).build().createClient(Service.class);
216-
217-
String actualResponse = service.getGreeting();
214+
String actualResponse =
215+
HttpServiceProxyFactory.builderFor(RestClientAdapter.create(restClient)).build()
216+
.createClient(Service.class).getGreeting();
218217

219218
RecordedRequest request = anotherServer.takeRequest();
220219
assertThat(request.getHeaders().get("X-Version")).isEqualTo("1.0");

spring-webflux/src/test/java/org/springframework/web/reactive/function/client/support/WebClientAdapterTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void greetingWithRequestAttribute() {
130130
assertThat(attributes).containsEntry("myAttribute", "myAttributeValue");
131131
}
132132

133-
@Test
133+
@Test // gh-36514
134134
void greetingWithDefaultApiVersion() throws InterruptedException {
135135
prepareResponse(builder -> builder.setHeader("Content-Type", "text/plain").body("Hello Spring 2!"));
136136

0 commit comments

Comments
 (0)