Skip to content

Commit 89caec9

Browse files
author
Oleksii Sokol
committed
testt
1 parent d11a4fc commit 89caec9

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

ManagedCode.Database.Tests/TestContainers/CosmosTestContainer.cs

+9-13
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ public async Task InitializeAsync()
9494
containerId = containerListResponse.ID;
9595
}
9696
}
97-
97+
98+
var httpMessageHandler = new HttpClientHandler()
99+
{
100+
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
101+
};
102+
98103
_database = new CosmosDatabase(new CosmosOptions
99104
{
100105
ConnectionString =
@@ -104,21 +109,12 @@ public async Task InitializeAsync()
104109
AllowTableCreation = true,
105110
CosmosClientOptions = new CosmosClientOptions()
106111
{
107-
HttpClientFactory = () =>
108-
{
109-
HttpMessageHandler httpMessageHandler = new HttpClientHandler()
110-
{
111-
ServerCertificateCustomValidationCallback =
112-
HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
113-
};
114-
115-
return new HttpClient(httpMessageHandler);
116-
},
117-
ConnectionMode = ConnectionMode.Gateway
112+
HttpClientFactory = () => new HttpClient(httpMessageHandler),
113+
ConnectionMode = ConnectionMode.Gateway,
114+
RequestTimeout = TimeSpan.FromMinutes(3)
118115
},
119116
});
120117

121-
122118
await _database.InitializeAsync();
123119
}
124120

0 commit comments

Comments
 (0)