File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
main/com/mongodb/async/client
test/functional/com/mongodb/async/client Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ private Builder() {
9595 }
9696
9797 private Builder (final com .mongodb .MongoClientSettings settings ) {
98+ isTrue ("auto-encryption settings is null" , settings .getAutoEncryptionSettings () == null );
9899 notNull ("settings" , settings );
99100 wrappedBuilder = com .mongodb .MongoClientSettings .builder (settings );
100101 MongoCredential credential = settings .getCredential ();
Original file line number Diff line number Diff line change 1616
1717package com.mongodb.async.client
1818
19+ import com.mongodb.AutoEncryptionSettings
1920import com.mongodb.MongoCompressor
2021import com.mongodb.MongoCredential
2122import com.mongodb.MongoDriverInformation
@@ -252,4 +253,17 @@ class MongoClientsSpecification extends FunctionalSpecification {
252253 }
253254 client?. close()
254255 }
256+
257+ def ' should throw if AutoEncryptionSettings is not null' () {
258+ when :
259+ MongoClients . create(com.mongodb.MongoClientSettings . builder()
260+ .autoEncryptionSettings(AutoEncryptionSettings . builder()
261+ .keyVaultNamespace(' test.keys' )
262+ .kmsProviders([local : [' key' : new byte [96 ]]])
263+ .build())
264+ .build())
265+
266+ then :
267+ thrown(IllegalStateException )
268+ }
255269}
You can’t perform that action at this time.
0 commit comments