diff --git a/CHANGELOG.md b/CHANGELOG.md index 8eebeec88..169b8d5cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +## [2.0.17] - 2023-03-20 + ### Changed +- Aligns default http client timeout to be 100 seconds - Fixes NullPointerException in GraphErrorResponse#copy ## [2.0.16] - 2023-01-30 diff --git a/gradle.properties b/gradle.properties index fa82b6c0b..d70226c27 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,7 @@ mavenGroupId = com.microsoft.graph mavenArtifactId = microsoft-graph-core mavenMajorVersion = 2 mavenMinorVersion = 0 -mavenPatchVersion = 16 +mavenPatchVersion = 17 mavenArtifactSuffix = #These values are used to run functional tests diff --git a/src/main/java/com/microsoft/graph/httpcore/HttpClients.java b/src/main/java/com/microsoft/graph/httpcore/HttpClients.java index 70e62756b..63bdeccf6 100644 --- a/src/main/java/com/microsoft/graph/httpcore/HttpClients.java +++ b/src/main/java/com/microsoft/graph/httpcore/HttpClients.java @@ -7,6 +7,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; +import java.time.Duration; import java.util.Objects; /** @@ -28,7 +29,10 @@ public static Builder custom() { return new OkHttpClient.Builder() .addInterceptor(new TelemetryHandler()) .followRedirects(false) - .followSslRedirects(false); + .followSslRedirects(false) + .connectTimeout(Duration.ofSeconds(100)) + .readTimeout(Duration.ofSeconds(100)) + .callTimeout(Duration.ofSeconds(100)); } /** diff --git a/src/test/java/com/microsoft/graph/httpcore/HttpClientsTest.java b/src/test/java/com/microsoft/graph/httpcore/HttpClientsTest.java index 86ea5f9b2..0b3a7a4bf 100644 --- a/src/test/java/com/microsoft/graph/httpcore/HttpClientsTest.java +++ b/src/test/java/com/microsoft/graph/httpcore/HttpClientsTest.java @@ -1,5 +1,6 @@ package com.microsoft.graph.httpcore; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; @@ -16,6 +17,9 @@ public class HttpClientsTest { public void testHttpClientCreation() { OkHttpClient httpclient = HttpClients.createDefault(mock(IAuthenticationProvider.class)); assertTrue(httpclient != null); + assertEquals(100000,httpclient.readTimeoutMillis()); + assertEquals(100000,httpclient.connectTimeoutMillis()); + assertEquals(100000,httpclient.callTimeoutMillis()); } @Test