|
35 | 35 |
|
36 | 36 | import org.springframework.aop.Advisor; |
37 | 37 | import org.springframework.boot.autoconfigure.AutoConfigurations; |
38 | | -import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration; |
39 | 38 | import org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder; |
40 | 39 | import org.springframework.boot.http.client.HttpClientSettings; |
41 | 40 | import org.springframework.boot.http.client.HttpRedirects; |
|
44 | 43 | import org.springframework.boot.restclient.RestClientCustomizer; |
45 | 44 | import org.springframework.boot.restclient.autoconfigure.RestClientAutoConfiguration; |
46 | 45 | import org.springframework.boot.test.context.runner.ApplicationContextRunner; |
47 | | -import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; |
48 | 46 | import org.springframework.context.annotation.Bean; |
49 | 47 | import org.springframework.context.annotation.Configuration; |
50 | 48 | import org.springframework.http.client.ClientHttpRequestFactory; |
|
56 | 54 | import org.springframework.web.client.support.RestClientHttpServiceGroupConfigurer; |
57 | 55 | import org.springframework.web.service.annotation.GetExchange; |
58 | 56 | import org.springframework.web.service.registry.HttpServiceGroup; |
59 | | -import org.springframework.web.service.registry.HttpServiceGroup.ClientType; |
60 | 57 | import org.springframework.web.service.registry.HttpServiceGroupConfigurer.ClientCallback; |
61 | 58 | import org.springframework.web.service.registry.HttpServiceGroupConfigurer.Groups; |
62 | 59 | import org.springframework.web.service.registry.HttpServiceProxyRegistry; |
63 | 60 | import org.springframework.web.service.registry.ImportHttpServices; |
64 | | -import org.springframework.web.util.UriComponentsBuilder; |
65 | 61 |
|
66 | 62 | import static org.assertj.core.api.Assertions.assertThat; |
67 | 63 | import static org.mockito.BDDMockito.given; |
@@ -221,23 +217,6 @@ void whenHasNoHttpServiceProxyRegistryBean() { |
221 | 217 | .run((context) -> assertThat(context).doesNotHaveBean(HttpServiceProxyRegistry.class)); |
222 | 218 | } |
223 | 219 |
|
224 | | - @Test |
225 | | - void restClientServiceClientsApplyPropertiesWhenReactiveWithVirtualThreads() { |
226 | | - new ReactiveWebApplicationContextRunner() |
227 | | - .withConfiguration(AutoConfigurations.of(HttpServiceClientAutoConfiguration.class, |
228 | | - ImperativeHttpClientAutoConfiguration.class, RestClientAutoConfiguration.class, |
229 | | - TaskExecutionAutoConfiguration.class)) |
230 | | - .withPropertyValues("spring.threads.virtual.enabled=true", |
231 | | - "spring.http.serviceclient.echo.base-url=https://example.com") |
232 | | - .withUserConfiguration(ReactiveHttpClientConfiguration.class) |
233 | | - .run((context) -> { |
234 | | - RestClient restClient = getRestClient(context.getBean(ReactiveTestClient.class)); |
235 | | - UriComponentsBuilder baseUri = (UriComponentsBuilder) Extractors.byName("uriBuilderFactory.baseUri") |
236 | | - .apply(restClient); |
237 | | - assertThat(baseUri.build().toUriString()).isEqualTo("https://example.com"); |
238 | | - }); |
239 | | - } |
240 | | - |
241 | 220 | private HttpClient getJdkHttpClient(Object proxy) { |
242 | 221 | return (HttpClient) Extractors.byName("clientRequestFactory.httpClient").apply(getRestClient(proxy)); |
243 | 222 | } |
@@ -336,17 +315,4 @@ interface TestClientTwo { |
336 | 315 |
|
337 | 316 | } |
338 | 317 |
|
339 | | - @Configuration(proxyBeanMethods = false) |
340 | | - @ImportHttpServices(types = ReactiveTestClient.class, clientType = ClientType.REST_CLIENT, group = "echo") |
341 | | - static class ReactiveHttpClientConfiguration { |
342 | | - |
343 | | - } |
344 | | - |
345 | | - interface ReactiveTestClient { |
346 | | - |
347 | | - @GetExchange("/echo") |
348 | | - String echo(); |
349 | | - |
350 | | - } |
351 | | - |
352 | 318 | } |
0 commit comments