Skip to content

Commit

Permalink
Polish "Avoid using OkHttp3ClientHttpRequestFactory in test"
Browse files Browse the repository at this point in the history
  • Loading branch information
mhalbritter committed May 2, 2024
1 parent 2004257 commit 1534bc8
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.springframework.http.client.ClientHttpRequest;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.mock.env.MockEnvironment;
import org.springframework.mock.http.client.MockClientHttpRequest;
Expand Down Expand Up @@ -86,10 +85,10 @@ void simple() {

@Test
void doNotReplaceCustomRequestFactory() {
RestTemplateBuilder builder = new RestTemplateBuilder().requestFactory(OkHttp3ClientHttpRequestFactory.class);
RestTemplateBuilder builder = new RestTemplateBuilder().requestFactory(TestClientHttpRequestFactory.class);
TestRestTemplate testRestTemplate = new TestRestTemplate(builder);
assertThat(testRestTemplate.getRestTemplate().getRequestFactory())
.isInstanceOf(OkHttp3ClientHttpRequestFactory.class);
.isInstanceOf(TestClientHttpRequestFactory.class);
}

@Test
Expand Down

0 comments on commit 1534bc8

Please sign in to comment.