@@ -32,19 +32,7 @@ public CosmosTestContainer()
32
32
. WithImage ( "mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator" )
33
33
. WithName ( containerName )
34
34
. WithExposedPort ( 8081 )
35
- . WithExposedPort ( 10250 )
36
- . WithExposedPort ( 10251 )
37
- . WithExposedPort ( 10252 )
38
- . WithExposedPort ( 10253 )
39
- . WithExposedPort ( 10254 )
40
- . WithExposedPort ( 10255 )
41
35
. WithPortBinding ( 8081 , 8081 )
42
- . WithPortBinding ( 10250 , 10250 )
43
- . WithPortBinding ( 10251 , 10251 )
44
- . WithPortBinding ( 10252 , 10252 )
45
- . WithPortBinding ( 10253 , 10253 )
46
- . WithPortBinding ( 10254 , 10254 )
47
- . WithPortBinding ( 10255 , 10255 )
48
36
. WithEnvironment ( "AZURE_COSMOS_EMULATOR_PARTITION_COUNT" , "1" )
49
37
. WithEnvironment ( "AZURE_COSMOS_EMULATOR_IP_ADDRESS_OVERRIDE" , "127.0.0.1" )
50
38
. WithEnvironment ( "AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE" , "false" )
@@ -98,27 +86,24 @@ public async Task InitializeAsync()
98
86
}
99
87
}
100
88
101
- var database = $ "db{ Guid . NewGuid ( ) . ToString ( "N" ) } ";
89
+ var httpMessageHandler = new HttpClientHandler ( )
90
+ {
91
+ ServerCertificateCustomValidationCallback = HttpClientHandler . DangerousAcceptAnyServerCertificateValidator
92
+ } ;
93
+
102
94
103
95
_database = new CosmosDatabase ( new CosmosOptions
104
96
{
105
97
ConnectionString =
106
98
$ "AccountEndpoint=https://localhost:{ publicPort } /;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
107
- DatabaseName = database ,
99
+ DatabaseName = " database" ,
108
100
CollectionName = $ "testContainer",
109
101
AllowTableCreation = true ,
110
102
CosmosClientOptions = new CosmosClientOptions ( )
111
103
{
112
- HttpClientFactory = ( ) =>
113
- {
114
- HttpMessageHandler httpMessageHandler = new HttpClientHandler ( )
115
- {
116
- ServerCertificateCustomValidationCallback = ( _ , _ , _ , _ ) => true
117
- } ;
118
-
119
- return new HttpClient ( httpMessageHandler ) ;
120
- } ,
121
- ConnectionMode = ConnectionMode . Gateway
104
+ HttpClientFactory = ( ) => new HttpClient ( httpMessageHandler ) ,
105
+ ConnectionMode = ConnectionMode . Gateway ,
106
+ RequestTimeout = TimeSpan . FromMinutes ( 3 )
122
107
} ,
123
108
} ) ;
124
109
0 commit comments