Skip to content
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

Fix #395: verify that "no options" Commands are not given any options #412

Merged
merged 5 commits into from
May 3, 2023

Conversation

tatu-at-datastax
Copy link
Contributor

What this PR does:

Adds validation for NoOptionsCommand so that attempts to send options results in a failure

Which issue(s) this PR fixes:
Fixes #395

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@tatu-at-datastax tatu-at-datastax self-assigned this May 2, 2023
*/
@JsonIgnoreProperties({"options"})
public interface NoOptionsCommand {}
@RegisterForReflection
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without this, Native build CI/ITs failed; adding made them pass. Not 100% sure why but suspecting that default method implementation (annotation included, in particular) would not be retained.
I am glad we have tests for that set up to catch these problems.

@tatu-at-datastax tatu-at-datastax marked this pull request as ready for review May 2, 2023 21:31
@tatu-at-datastax tatu-at-datastax requested a review from a team as a code owner May 2, 2023 21:31
Copy link
Contributor

@maheshrajamani maheshrajamani left a comment

Choose a reason for hiding this comment

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

LGTM. Can you add unit test case for DeleteOne, and InsertOne?


// Only "empty" Options allowed, nothing else
@Test
public void illegalFilterConditionEmptyOptions() throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this test be moved into ObjectMapperConfigurationTest.FindOne? Thats where the command is resolved.
This class is used to test resolving commands to operation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@maheshrajamani Ok makes sense, will move.

@tatu-at-datastax
Copy link
Contributor Author

LGTM. Can you add unit test case for DeleteOne, and InsertOne?

Yes, will add to same place where FindOneCommand unit test goes.

@tatu-at-datastax tatu-at-datastax merged commit 70e12b3 into main May 3, 2023
@tatu-at-datastax tatu-at-datastax deleted the tatu/395-verify-no-options branch May 3, 2023 01:36
Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

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.

findOne with options should throw an error back
3 participants