use of cn.taketoday.http.client.ClientHttpRequestFactory in project today-infrastructure by TAKETODAY.
the class RestTemplateBuilderTests method connectTimeoutCanBeConfiguredOnSimpleRequestFactory.
@Test
void connectTimeoutCanBeConfiguredOnSimpleRequestFactory() {
ClientHttpRequestFactory requestFactory = this.builder.requestFactory(SimpleClientHttpRequestFactory.class).setConnectTimeout(Duration.ofMillis(1234)).build().getRequestFactory();
assertThat(requestFactory).hasFieldOrPropertyWithValue("connectTimeout", 1234);
}
use of cn.taketoday.http.client.ClientHttpRequestFactory in project today-infrastructure by TAKETODAY.
the class RestTemplateBuilderTests method readTimeoutCanBeConfiguredOnOkHttp3RequestFactory.
@Test
void readTimeoutCanBeConfiguredOnOkHttp3RequestFactory() {
ClientHttpRequestFactory requestFactory = this.builder.requestFactory(OkHttp3ClientHttpRequestFactory.class).setReadTimeout(Duration.ofMillis(1234)).build().getRequestFactory();
assertThat(requestFactory).isInstanceOf(OkHttp3ClientHttpRequestFactory.class);
assertThat(requestFactory).extracting("client").extracting("readTimeoutMillis").isEqualTo(1234);
}
Aggregations