@@ -49,6 +49,7 @@ public class ClientEncryptionTests
4949 [ Fact ]
5050 public async Task AddAlternateKeyName_should_correctly_handle_input_arguments ( )
5151 {
52+ RequireEnvironment . Check ( ) . EnvironmentVariable ( "FLE_AWS_KEY" ) ;
5253 RequireServer . Check ( ) . Supports ( Feature . ClientSideEncryption ) ;
5354
5455 var guid = new Guid ( ) ;
@@ -63,6 +64,7 @@ public async Task AddAlternateKeyName_should_correctly_handle_input_arguments()
6364 [ Fact ]
6465 public async Task CreateDataKey_should_correctly_handle_input_arguments ( )
6566 {
67+ RequireEnvironment . Check ( ) . EnvironmentVariable ( "FLE_AWS_KEY" ) ;
6668 RequireServer . Check ( ) . Supports ( Feature . ClientSideEncryption ) ;
6769
6870 using ( var subject = CreateSubject ( ) )
@@ -78,6 +80,8 @@ public async Task CreateDataKey_should_correctly_handle_input_arguments()
7880 [ Fact ]
7981 public async Task CreateEncryptedCollection_should_handle_input_arguments ( )
8082 {
83+ RequireEnvironment . Check ( ) . EnvironmentVariable ( "FLE_AWS_KEY" ) ;
84+
8185 const string kmsProvider = "local" ;
8286 const string collectionName = "collName" ;
8387 var createCollectionOptions = new CreateCollectionOptions ( ) ;
@@ -119,6 +123,8 @@ public async Task CreateEncryptedCollection_should_handle_input_arguments()
119123 [ Fact ]
120124 public async Task CreateEncryptedCollection_should_handle_generated_key_when_second_key_failed ( )
121125 {
126+ RequireEnvironment . Check ( ) . EnvironmentVariable ( "FLE_AWS_KEY" ) ;
127+
122128 const string kmsProvider = "local" ;
123129 const string collectionName = "collName" ;
124130 const string encryptedFieldsStr = "{ fields : [{ keyId : null }, { keyId : null }] }" ;
@@ -210,6 +216,8 @@ datakeys have already been created by the helper.
210216 [ InlineData ( "{ fields : [{ keyId : 3 }, { keyId : null }] }" , "{ fields: [{ keyId : 3 }, { keyId : '#binary_generated#' }] }" ) ]
211217 public async Task CreateEncryptedCollection_should_handle_various_encryptedFields ( string encryptedFieldsStr , string expectedResult )
212218 {
219+ RequireEnvironment . Check ( ) . EnvironmentVariable ( "FLE_AWS_KEY" ) ;
220+
213221 const string kmsProvider = "local" ;
214222 const string collectionName = "collName" ;
215223 var serverId = new ServerId ( __clusterId , __endPoint ) ;
@@ -287,6 +295,7 @@ public bool Equals(BsonDocument x, BsonDocument y) =>
287295 [ Fact ]
288296 public void CryptClient_should_be_initialized ( )
289297 {
298+ RequireEnvironment . Check ( ) . EnvironmentVariable ( "FLE_AWS_KEY" ) ;
290299 RequireServer . Check ( ) . Supports ( Feature . ClientSideEncryption ) ;
291300
292301 using ( var subject = CreateSubject ( ) )
@@ -299,6 +308,7 @@ public void CryptClient_should_be_initialized()
299308 [ Fact ]
300309 public async Task Decrypt_should_correctly_handle_input_arguments ( )
301310 {
311+ RequireEnvironment . Check ( ) . EnvironmentVariable ( "FLE_AWS_KEY" ) ;
302312 RequireServer . Check ( ) . Supports ( Feature . ClientSideEncryption ) ;
303313
304314 using ( var subject = CreateSubject ( ) )
@@ -311,6 +321,7 @@ public async Task Decrypt_should_correctly_handle_input_arguments()
311321 [ Fact ]
312322 public async Task Encrypt_should_correctly_handle_input_arguments ( )
313323 {
324+ RequireEnvironment . Check ( ) . EnvironmentVariable ( "FLE_AWS_KEY" ) ;
314325 RequireServer . Check ( ) . Supports ( Feature . ClientSideEncryption ) ;
315326
316327 using ( var subject = CreateSubject ( ) )
@@ -327,6 +338,7 @@ public async Task Encrypt_should_correctly_handle_input_arguments()
327338 [ ParameterAttributeData ]
328339 public async Task Encryption_should_use_correct_binarySubType ( [ Values ( false , true ) ] bool async )
329340 {
341+ RequireEnvironment . Check ( ) . EnvironmentVariable ( "FLE_AWS_KEY" ) ;
330342 RequireServer . Check ( ) . Supports ( Feature . ClientSideEncryption ) ;
331343
332344 using ( var subject = CreateSubject ( ) )
@@ -347,6 +359,7 @@ public async Task Encryption_should_use_correct_binarySubType([Values(false, tru
347359 [ Fact ]
348360 public async Task GetKeyByAlternateKeyName_should_correctly_handle_input_arguments ( )
349361 {
362+ RequireEnvironment . Check ( ) . EnvironmentVariable ( "FLE_AWS_KEY" ) ;
350363 RequireServer . Check ( ) . Supports ( Feature . ClientSideEncryption ) ;
351364
352365 using ( var subject = CreateSubject ( ) )
@@ -359,6 +372,7 @@ public async Task GetKeyByAlternateKeyName_should_correctly_handle_input_argumen
359372 [ Fact ]
360373 public async Task RemoveAlternateKeyName_should_correctly_handle_input_arguments ( )
361374 {
375+ RequireEnvironment . Check ( ) . EnvironmentVariable ( "FLE_AWS_KEY" ) ;
362376 RequireServer . Check ( ) . Supports ( Feature . ClientSideEncryption ) ;
363377
364378 var guid = new Guid ( ) ;
@@ -373,6 +387,7 @@ public async Task RemoveAlternateKeyName_should_correctly_handle_input_arguments
373387 [ Fact ]
374388 public async Task RewrapManyDataKey_should_correctly_handle_input_arguments ( )
375389 {
390+ RequireEnvironment . Check ( ) . EnvironmentVariable ( "FLE_AWS_KEY" ) ;
376391 RequireServer . Check ( ) . Supports ( Feature . ClientSideEncryption ) ;
377392
378393 using ( var subject = CreateSubject ( ) )
@@ -391,7 +406,7 @@ private ClientEncryption CreateSubject(IMongoClient client = null)
391406 var clientEncryptionOptions = new ClientEncryptionOptions (
392407 client ?? DriverTestConfiguration . Client ,
393408 __keyVaultCollectionNamespace ,
394- kmsProviders : EncryptionTestHelper . GetKmsProviders ( filter : "local" ) ) ;
409+ kmsProviders : EncryptionTestHelper . GetKmsProviders ( "local" ) ) ;
395410
396411 return new ClientEncryption ( clientEncryptionOptions ) ;
397412 }
0 commit comments