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
Bugfix: fixed more Cosmos DB tests #1316
Bugfix: fixed more Cosmos DB tests #1316
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1316 +/- ##
==========================================
+ Coverage 67.51% 67.64% +0.12%
==========================================
Files 717 712 -5
Lines 15756 15645 -111
Branches 1051 1037 -14
==========================================
- Hits 10638 10583 -55
+ Misses 4635 4588 -47
+ Partials 483 474 -9 Continue to review full report at Codecov.
|
1a99a78
to
0d620dd
Compare
@@ -420,7 +420,7 @@ void findAll_verifyFiltering_invalidFilterExpression() { | |||
|
|||
var query = QuerySpec.Builder.newInstance().filter("something contains other").build(); | |||
|
|||
assertThatThrownBy(() -> store.queryNegotiations(query)).isInstanceOfAny(IllegalArgumentException.class).hasMessage("Cannot build SqlParameter for operator: contains"); | |||
assertThatThrownBy(() -> store.queryNegotiations(query)).isInstanceOfAny(IllegalArgumentException.class).hasMessage("Cannot build WHERE clause, reason: unsupported operator contains"); |
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.
In general I would avoid testing exception messages, especially in integration tests
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.
Well to me it seems a good idea, so we ensure the exception we are testing for is not masked by an unrelated one
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 tend to agree with @algattik, and asserting exception message has already surfaced problems for me on several occasions. I like tests to be as rigid as possible - you can never be too certain :)
What this PR changes/adds
fixes more CosmosDB tests, which were not caught by the previous PR #1315
Why it does that
Briefly state why the change was necessary.
Further notes
There seems to be a functional difference between the Cosmos Emulator (which I used for testing locally) and the actual CosmosDB instance: when sorting based on a non-existing field, the cosmos emulator returns an empty list, whereas on the "real" cosmos does not affect the result.
Linked Issue(s)
Closes #1313
Checklist
no-changelog
)