-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Support Range Indexes as GA. #1465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add prose tests. - Update specification tests. - Move duplicated code to EncryptionFixture. JAVA-5537
JAVA-5537
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've consolidated the common initialization logic, previously repeated across encryption tests, into a new EncryptionFixture.
JAVA-5537
JAVA-5537
JAVA-5537
JAVA-5557
JAVA-5557
JAVA-5557
@@ -305,11 +305,10 @@ BsonDocument getRunCommandResult(final BsonDocument collectionOptions, final Bso | |||
response = database.runCommand(clientSession, command, readPreference, BsonDocument.class); | |||
} | |||
} | |||
response.remove("ok"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the legacy test format specification:
If the operation returns a raw command response, e.g., from runCommand, then compare only the fields present in the expected result document.
Therefore, we should not remove any fields from the response. Instead, we should only compare the fields that are explicitly expected and ignore any additional fields that are not specified in the expected results.
JAVA-5441
@Nullable | ||
public Integer getTrimFactor() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weird that this method was not @Nullable
previously, as there was nothing that prevented it from returning null
.
driver-sync/src/test/functional/com/mongodb/fixture/EncryptionFixture.java
Show resolved
Hide resolved
kmsProviders = new HashMap<>(); | ||
Map<String, Object> localProviderMap = new HashMap<>(); | ||
localProviderMap.put("key", | ||
Base64.getDecoder().decode( | ||
"Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZ" | ||
+ "GJkTXVyZG9uSjFk")); | ||
kmsProviders.put("local", localProviderMap); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thank you for removing all this code duplication, and making tests clearer.
...ional/com/mongodb/client/AbstractClientSideEncryptionRangeDefaultExplicitEncryptionTest.java
Outdated
Show resolved
Hide resolved
...ional/com/mongodb/client/AbstractClientSideEncryptionRangeDefaultExplicitEncryptionTest.java
Show resolved
Hide resolved
...ional/com/mongodb/client/AbstractClientSideEncryptionRangeDefaultExplicitEncryptionTest.java
Outdated
Show resolved
Hide resolved
...ional/com/mongodb/client/AbstractClientSideEncryptionRangeDefaultExplicitEncryptionTest.java
Outdated
Show resolved
Hide resolved
...ional/com/mongodb/client/AbstractClientSideEncryptionRangeDefaultExplicitEncryptionTest.java
Outdated
Show resolved
Hide resolved
...m/mongodb/reactivestreams/client/ClientSideEncryptionRangeDefaultExplicitEncryptionTest.java
Outdated
Show resolved
Hide resolved
…entSideEncryptionRangeDefaultExplicitEncryptionTest.java Co-authored-by: Valentin Kovalenko <valentin.male.kovalenko@gmail.com>
Add JavaDoc. JAVA-5537
* @param trimFactor the trim factor | ||
* @return this | ||
* @since 5.2 | ||
*/ | ||
public RangeOptions setTrimFactor(final Integer trimFactor) { | ||
public RangeOptions setTrimFactor(@Nullable final Integer trimFactor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Can we rename this to trimFactor
. Using the API having the set
prefix really sticks out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely, good catch! I've renamed it to trimFactor()
.
JAVA-5537
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
JAVA-5537
JAVA-5441