-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Test: Simplify collection and optional assertions #13613
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
29b146c
to
010dfc8
Compare
|
||
assertThat(cache.size()).isEqualTo(1); | ||
assertThat(cache).containsExactlyEntriesOf(Map.of(1, 1)); | ||
assertThat(cache).hasSize(1).containsExactlyEntriesOf(Map.of(1, 1)); |
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.
assertThat(cache).hasSize(1).containsExactlyEntriesOf(Map.of(1, 1)); | |
assertThat(cache).hasSize(1).containsEntry(1, 1); |
|
||
assertThat(cache.size()).isEqualTo(2); | ||
assertThat(cache).containsExactly(Map.entry(1, 1), Map.entry(3, 3)); | ||
assertThat(cache).hasSize(2).containsExactly(Map.entry(1, 1), Map.entry(3, 3)); |
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.
assertThat(cache).hasSize(2).containsExactly(Map.entry(1, 1), Map.entry(3, 3)); | |
assertThat(cache).hasSize(2).containsEntry(1, 1).containsEntry(3, 3); |
double maxDriftPercentage) { | ||
|
||
assertThat(partitionResults.size()).isEqualTo(expectedAssignmentInfo.size()); | ||
assertThat(partitionResults).hasSize(expectedAssignmentInfo.size()); |
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.
assertThat(partitionResults).hasSize(expectedAssignmentInfo.size()); | |
assertThat(partitionResults).hasSameSizeAs(expectedAssignmentInfo); |
FlinkParquetReaders.buildReader(new Schema(SUPPORTED_PRIMITIVES.fields()), fileSchema); | ||
|
||
assertThat(reader.columns().size()).isEqualTo(SUPPORTED_PRIMITIVES.fields().size()); | ||
assertThat(reader.columns()).hasSize(SUPPORTED_PRIMITIVES.fields().size()); |
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.
assertThat(reader.columns()).hasSize(SUPPORTED_PRIMITIVES.fields().size()); | |
assertThat(reader.columns()).hasSameSizeAs(SUPPORTED_PRIMITIVES.fields()); |
|
||
assertThat(cache.size()).isEqualTo(1); | ||
assertThat(cache).containsExactlyEntriesOf(Map.of(1, 1)); | ||
assertThat(cache).hasSize(1).containsExactlyEntriesOf(Map.of(1, 1)); |
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.
same as above
|
||
// verify that the dataframe matches | ||
assertThat(rows.size()).isEqualTo(records.size()); | ||
assertThat(rows).hasSize(records.size()); |
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.
assertThat(rows).hasSize(records.size()); | |
assertThat(rows).hasSameSizeAs(records); |
the advantage here is that this will also show the content of actual/expected when the assertion ever fails
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 you also please update all the other places that are affected in this PR?
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.
Thanks for your suggestion. Addressed comments.
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, thanks for cleaning this up @ebyhr
No description provided.