Skip to content

Commit

Permalink
Avoid using OkHttp3ClientHttpRequestFactory in test
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll authored and mhalbritter committed May 2, 2024
1 parent 3b7d477 commit 2004257
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -94,7 +94,7 @@ void doNotReplaceCustomRequestFactory() {

@Test
void useTheSameRequestFactoryClassWithBasicAuth() {
OkHttp3ClientHttpRequestFactory customFactory = new OkHttp3ClientHttpRequestFactory();
TestClientHttpRequestFactory customFactory = new TestClientHttpRequestFactory();
RestTemplateBuilder builder = new RestTemplateBuilder().requestFactory(() -> customFactory);
TestRestTemplate testRestTemplate = new TestRestTemplate(builder).withBasicAuth("test", "test");
RestTemplate restTemplate = testRestTemplate.getRestTemplate();
Expand Down Expand Up @@ -386,4 +386,8 @@ interface TestRestTemplateCallback {

}

static class TestClientHttpRequestFactory extends SimpleClientHttpRequestFactory {

}

}

0 comments on commit 2004257

Please sign in to comment.