Avoid using OkHttp3ClientHttpRequestFactory in test
See gh-40611
This commit is contained in:
parent
3b7d4779c4
commit
20042576e9
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2012-2023 the original author or authors.
|
* Copyright 2012-2024 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -94,7 +94,7 @@ class TestRestTemplateTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void useTheSameRequestFactoryClassWithBasicAuth() {
|
void useTheSameRequestFactoryClassWithBasicAuth() {
|
||||||
OkHttp3ClientHttpRequestFactory customFactory = new OkHttp3ClientHttpRequestFactory();
|
TestClientHttpRequestFactory customFactory = new TestClientHttpRequestFactory();
|
||||||
RestTemplateBuilder builder = new RestTemplateBuilder().requestFactory(() -> customFactory);
|
RestTemplateBuilder builder = new RestTemplateBuilder().requestFactory(() -> customFactory);
|
||||||
TestRestTemplate testRestTemplate = new TestRestTemplate(builder).withBasicAuth("test", "test");
|
TestRestTemplate testRestTemplate = new TestRestTemplate(builder).withBasicAuth("test", "test");
|
||||||
RestTemplate restTemplate = testRestTemplate.getRestTemplate();
|
RestTemplate restTemplate = testRestTemplate.getRestTemplate();
|
||||||
|
@ -386,4 +386,8 @@ class TestRestTemplateTests {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static class TestClientHttpRequestFactory extends SimpleClientHttpRequestFactory {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue