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

test: improve test assertions #1473

Merged
merged 12 commits into from May 16, 2024
Merged

test: improve test assertions #1473

merged 12 commits into from May 16, 2024

Conversation

anyulled
Copy link
Contributor

@anyulled anyulled commented Mar 14, 2024

  • According to the AssertJ library, the assertThat() method must be followed by an assertion invocation, otherwise what is intended to be a test doesn't actually verify anything.
  • Replacing isEqualTo() with hasToString() assertion increases readability of the code for verifying toString() methods.
  • replacing isNotEqualTo(0) with isNotZero() to improve readability.
  • Replace assertThat(owner6.getPets().size()).isEqualTo(found + 1) with assertThat(owner6.getPets()).hasSize(found + 1); for better code readability.
  • Replace JUnit's assertEqual() assertion with AssertJ assertThat().isEqualTo() for improved readability and consistent use within the project.

solves #1474

@pivotal-cla
Copy link

@anyulled Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@anyulled Thank you for signing the Contributor License Agreement!

@anyulled anyulled changed the title test: complete assertions test: improve test assertions Mar 14, 2024
Copy link
Contributor

@zyberzebra zyberzebra left a comment

Choose a reason for hiding this comment

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

Looks good to me 🤘🏼🔥

Copy link
Contributor

@zyberzebra zyberzebra left a comment

Choose a reason for hiding this comment

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

Looks good :)

@anyulled
Copy link
Contributor Author

@zyberzebra Who else needs to approve this pull request for merging it?

@zyberzebra
Copy link
Contributor

One of the Maintainers.

@dsyer dsyer merged commit 8f79926 into spring-projects:main May 16, 2024
1 check passed
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.

None yet

4 participants