mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish "Avoid using OkHttp3ClientHttpRequestFactory in test"
See gh-40611
This commit is contained in:
parent
20042576e9
commit
1534bc8ad2
@ -38,7 +38,6 @@ import org.springframework.http.RequestEntity;
|
|||||||
import org.springframework.http.client.ClientHttpRequest;
|
import org.springframework.http.client.ClientHttpRequest;
|
||||||
import org.springframework.http.client.ClientHttpRequestFactory;
|
import org.springframework.http.client.ClientHttpRequestFactory;
|
||||||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
||||||
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
|
|
||||||
import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||||
import org.springframework.mock.env.MockEnvironment;
|
import org.springframework.mock.env.MockEnvironment;
|
||||||
import org.springframework.mock.http.client.MockClientHttpRequest;
|
import org.springframework.mock.http.client.MockClientHttpRequest;
|
||||||
@ -86,10 +85,10 @@ class TestRestTemplateTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void doNotReplaceCustomRequestFactory() {
|
void doNotReplaceCustomRequestFactory() {
|
||||||
RestTemplateBuilder builder = new RestTemplateBuilder().requestFactory(OkHttp3ClientHttpRequestFactory.class);
|
RestTemplateBuilder builder = new RestTemplateBuilder().requestFactory(TestClientHttpRequestFactory.class);
|
||||||
TestRestTemplate testRestTemplate = new TestRestTemplate(builder);
|
TestRestTemplate testRestTemplate = new TestRestTemplate(builder);
|
||||||
assertThat(testRestTemplate.getRestTemplate().getRequestFactory())
|
assertThat(testRestTemplate.getRestTemplate().getRequestFactory())
|
||||||
.isInstanceOf(OkHttp3ClientHttpRequestFactory.class);
|
.isInstanceOf(TestClientHttpRequestFactory.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user