use of org.springframework.http.client.reactive.JettyClientHttpConnector in project spring-boot by spring-projects.
the class ClientHttpConnectorConfigurationTests method jettyClientHttpConnectorAppliesJettyResourceFactory.
@Test
void jettyClientHttpConnectorAppliesJettyResourceFactory() {
Executor executor = mock(Executor.class);
ByteBufferPool byteBufferPool = mock(ByteBufferPool.class);
Scheduler scheduler = mock(Scheduler.class);
JettyResourceFactory jettyResourceFactory = new JettyResourceFactory();
jettyResourceFactory.setExecutor(executor);
jettyResourceFactory.setByteBufferPool(byteBufferPool);
jettyResourceFactory.setScheduler(scheduler);
JettyClientHttpConnector connector = getClientHttpConnector(jettyResourceFactory);
HttpClient httpClient = (HttpClient) ReflectionTestUtils.getField(connector, "httpClient");
assertThat(httpClient.getExecutor()).isSameAs(executor);
assertThat(httpClient.getByteBufferPool()).isSameAs(byteBufferPool);
assertThat(httpClient.getScheduler()).isSameAs(scheduler);
}
use of org.springframework.http.client.reactive.JettyClientHttpConnector in project spring-boot by spring-projects.
the class ClientHttpConnectorConfigurationTests method JettyResourceFactoryHasSslContextFactory.
@Test
void JettyResourceFactoryHasSslContextFactory() {
// gh-16810
JettyResourceFactory jettyResourceFactory = new JettyResourceFactory();
JettyClientHttpConnector connector = getClientHttpConnector(jettyResourceFactory);
HttpClient httpClient = (HttpClient) ReflectionTestUtils.getField(connector, "httpClient");
assertThat(httpClient.getSslContextFactory()).isNotNull();
}
Aggregations