Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade group("com.squareup.okhttp3") to 4.4.1 and start using bom. #20592

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -36,12 +36,16 @@ public class InfluxDbProperties {
/**
* Login user.
*/
private String user;
// null value leads invalid basic auth setup and RuntimeException until
// https://github.com/influxdata/influxdb-java/pull/644 released.
private String user = "";

/**
* Login password.
*/
private String password;
// null value leads invalid basic auth setup and RuntimeException until
// https://github.com/influxdata/influxdb-java/pull/644 released.
private String password = "";

public String getUrl() {
return this.url;
Expand Down
16 changes: 4 additions & 12 deletions spring-boot-project/spring-boot-dependencies/build.gradle
Expand Up @@ -566,7 +566,7 @@ bom {
]
}
}
library("InfluxDB Java", "2.17") {
library("InfluxDB Java", "2.17") { // Maybe we can refactor InfluxDbProperties.java when update it.
group("org.influxdb") {
modules = [
"influxdb-java"
Expand Down Expand Up @@ -1295,18 +1295,10 @@ bom {
]
}
}
library("OkHttp3", "3.14.7") {
library("OkHttp", "4.4.1") {
group("com.squareup.okhttp3") {
modules = [
"logging-interceptor",
"mockwebserver",
"okcurl",
"okhttp",
"okhttp-dnsoverhttps",
"okhttp-sse",
"okhttp-testing-support",
"okhttp-tls",
"okhttp-urlconnection"
imports = [
"okhttp-bom"
]
}
}
Expand Down
Expand Up @@ -25,6 +25,7 @@
import java.util.Set;
import java.util.function.Supplier;

import okhttp3.OkHttpClient;
import org.apache.http.client.config.RequestConfig;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -532,16 +533,16 @@ void bufferRequestBodyCanBeConfiguredOnSimpleRequestFactory() {
void connectTimeoutCanBeConfiguredOnOkHttp3RequestFactory() {
ClientHttpRequestFactory requestFactory = this.builder.requestFactory(OkHttp3ClientHttpRequestFactory.class)
.setConnectTimeout(Duration.ofMillis(1234)).build().getRequestFactory();
assertThat(
ReflectionTestUtils.getField(ReflectionTestUtils.getField(requestFactory, "client"), "connectTimeout"))
.isEqualTo(1234);
assertThat(((OkHttpClient) ReflectionTestUtils.getField(requestFactory, "client")).connectTimeoutMillis())
.isEqualTo(1234);
}

@Test
void readTimeoutCanBeConfiguredOnOkHttp3RequestFactory() {
ClientHttpRequestFactory requestFactory = this.builder.requestFactory(OkHttp3ClientHttpRequestFactory.class)
.setReadTimeout(Duration.ofMillis(1234)).build().getRequestFactory();
assertThat(requestFactory).extracting("client").extracting("readTimeout").isEqualTo(1234);
assertThat(((OkHttpClient) ReflectionTestUtils.getField(requestFactory, "client")).readTimeoutMillis())
.isEqualTo(1234);
}

@Test
Expand Down