Skip to content

Commit 2004257

Browse files
snicollmhalbritter
authored andcommitted
Avoid using OkHttp3ClientHttpRequestFactory in test
See gh-40611
1 parent 3b7d477 commit 2004257

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/client/TestRestTemplateTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -94,7 +94,7 @@ void doNotReplaceCustomRequestFactory() {
9494

9595
@Test
9696
void useTheSameRequestFactoryClassWithBasicAuth() {
97-
OkHttp3ClientHttpRequestFactory customFactory = new OkHttp3ClientHttpRequestFactory();
97+
TestClientHttpRequestFactory customFactory = new TestClientHttpRequestFactory();
9898
RestTemplateBuilder builder = new RestTemplateBuilder().requestFactory(() -> customFactory);
9999
TestRestTemplate testRestTemplate = new TestRestTemplate(builder).withBasicAuth("test", "test");
100100
RestTemplate restTemplate = testRestTemplate.getRestTemplate();
@@ -386,4 +386,8 @@ interface TestRestTemplateCallback {
386386

387387
}
388388

389+
static class TestClientHttpRequestFactory extends SimpleClientHttpRequestFactory {
390+
391+
}
392+
389393
}

0 commit comments

Comments
 (0)