Skip to content

Support auto encryption in unified tests #1727

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

rozza
Copy link
Member

@rozza rozza commented Jun 5, 2025

Added support for schema 1.23

JAVA-5792

Added support for schema 1.23

JAVA-5792
@rozza rozza requested a review from Copilot June 5, 2025 11:42
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the unified test framework to support schema version 1.23 and adds auto-encryption and encrypted fields options in tests.

  • Bump max supported schema version to 1.23
  • Add autoEncryptOpts parsing in Entities.java
  • Support encryptedFields in collection creation in CollectionHelper.java

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTest.java Updated max supported schema version to "1.23"
driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java Imported and handled new autoEncryptOpts options
driver-core/src/test/functional/com/mongodb/client/test/CollectionHelper.java Added encryptedFields option to collection creation
Comments suppressed due to low confidence (4)

driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java:608

  • There are no tests covering the new autoEncryptOpts path; consider adding unified test JSON cases that exercise each encryption option to ensure correct behavior.
if (entity.containsKey("autoEncryptOpts")) {

driver-core/src/test/functional/com/mongodb/client/test/CollectionHelper.java:179

  • The new encryptedFields collection option is not covered by existing tests; add functional tests to validate this behavior during collection creation.
case "encryptedFields":

driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java:651

  • The AutoEncryptionSettings.Builder does not define a keyExpiration(long, TimeUnit) method; this will fail to compile. Verify the correct builder API or remove this unsupported option.
case "keyExpirationMS":

driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java:652

  • Missing import for TimeUnit. Add import java.util.concurrent.TimeUnit; at the top of the file to resolve this reference.
builder.keyExpiration(entry.getValue().asNumber().longValue(), TimeUnit.MILLISECONDS);

…ities.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant