diff --git a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/RxDocumentClientImplTest.java b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/RxDocumentClientImplTest.java index 7ea3c5b87322f..2c6411334ad41 100644 --- a/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/RxDocumentClientImplTest.java +++ b/sdk/cosmos/azure-cosmos-tests/src/test/java/com/azure/cosmos/implementation/RxDocumentClientImplTest.java @@ -10,6 +10,7 @@ import com.azure.cosmos.CosmosDiagnostics; import com.azure.cosmos.CosmosEndToEndOperationLatencyPolicyConfig; import com.azure.cosmos.CosmosItemSerializer; +import com.azure.cosmos.Http2ConnectionConfig; import com.azure.cosmos.SessionRetryOptions; import com.azure.cosmos.implementation.apachecommons.lang.tuple.ImmutablePair; import com.azure.cosmos.implementation.caches.RxClientCollectionCache; @@ -179,6 +180,7 @@ public void readMany() { Mockito.when(this.connectionPolicyMock.getMaxConnectionPoolSize()).thenReturn(dummyInt); Mockito.when(this.connectionPolicyMock.getProxy()).thenReturn(dummyProxyOptions); Mockito.when(this.connectionPolicyMock.getHttpNetworkRequestTimeout()).thenReturn(dummyDuration); + Mockito.when(this.connectionPolicyMock.getHttp2ConnectionConfig()).thenReturn(new Http2ConnectionConfig()); httpClientMock .when(() -> HttpClient.createFixed(Mockito.any(HttpClientConfig.class))) diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/http/HttpClientConfig.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/http/HttpClientConfig.java index d7a25196a55c5..f556e012426ea 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/http/HttpClientConfig.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/http/HttpClientConfig.java @@ -172,6 +172,6 @@ public String toDiagnosticsString() { maxIdleConnectionTimeout, connectionAcquireTimeout, proxy != null, - http2ConnectionConfig.toDiagnosticsString()); + http2ConnectionConfig == null ? null : http2ConnectionConfig.toDiagnosticsString()); } }