FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-70: Move from `hamcrest` to `assertj` in `flight-sql` by rtadepalli · Pull Request #772 · apache/arrow-java · GitHub

GH-70: Move from hamcrest to assertj in flight-sql - #772

Merged
lidavidm merged 3 commits into
apache:mainfrom
rtadepalli:add-assertj-to-flight-sql
May 28, 2025
Merged

GH-70: Move from hamcrest to assertj in flight-sql#772
lidavidm merged 3 commits into
apache:mainfrom
rtadepalli:add-assertj-to-flight-sql

Conversation

Copy link
Copy Markdown
Contributor

What's Changed

Series of PRs to consolidate on using assertj in tests as part of #70.

This comment has been minimized.

containsString("SQL"), // pk_key_name
is("3"), // update_rule
is("3")); // delete_rule
new HamcrestCondition<>(nullValue(String.class)), // pk_catalog_name

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Not particularly certain how to get rid of Hamcrest entirely here. I was aware of HamcrestCondition so using that, but open to suggestions if anyone knows how this list-based matching can be accomplished solely using assertj.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Using a list of lambdas?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Entirely overlooked that assertj provides lambda based conditions. Changed. Thanks.

lidavidm added the chore PRs that make misc changes. label May 27, 2025

Copy link
Copy Markdown
Contributor Author

I've formatted my changes using mvn spotless:apply.

lidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for doing this!

final FlightInfo info = sqlClient.getTables(null, null, null, null, true);
MatcherAssert.assertThat(
info.getSchemaOptional(), is(Optional.of(FlightSqlProducer.Schemas.GET_TABLES_SCHEMA)));
Assertions.assertThat(info.getSchemaOptional())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

nit, but IMO it's OK to statically import assertThat.

containsString("SQL"), // pk_key_name
is("3"), // update_rule
is("3")); // delete_rule
new HamcrestCondition<>(nullValue(String.class)), // pk_catalog_name

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Using a list of lambdas?

lidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks!

lidavidm merged commit 17f85a1 into apache:main May 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore PRs that make misc changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL