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
chore: add sync expression to multi-auth test #1506
Conversation
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.
Few comments here and there, but looks good otherwise.
.syncExpression(modelSchema.getName(), new DataStoreSyncExpression() { | ||
@Override | ||
public QueryPredicate resolvePredicate() { | ||
return Where.id("FAKE_ID").getQueryPredicate(); | ||
} | ||
}) |
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.
can't we use lambda here?
.syncExpression(modelSchema.getName(), () -> Where.id("FAKE_ID").getQueryPredicate())
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.
Where.id()
helper method also has a bug with ambiguous column names IIRC. I guess it's fine unless we start writing multiauth tests that has model relationship
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.
Yeah...I think for the purposes of this test, we're using a single table for each test case so we should be OK
.errorHandler(exception -> { | ||
Log.e(tag, | ||
"DataStore error handler received an error.", | ||
exception); | ||
}) |
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.
we don't need {}
for single liners :)
.errorHandler(error -> Log.e(tag, message, error))
but even better, wouldn't a Hub publish be more useful here for testing?
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.
Updated it to be a lambda expression. I only added this in here to make sure we could pick up on any exceptions thrown during the test. We can explore some alternatives as part of a different PR though.
Issue #, if available:
Description of changes:
Some of the multi-auth tests were failing sporadically likely due to the amount of data being sync'd. The sync expression should prevent that.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.