spring-petclinic
spring-petclinic copied to clipboard
test: improve test assertions
- 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()
withhasToString()
assertion increases readability of the code for verifyingtoString()
methods. - replacing
isNotEqualTo(0)
withisNotZero()
to improve readability. - Replace
assertThat(owner6.getPets().size()).isEqualTo(found + 1)
withassertThat(owner6.getPets()).hasSize(found + 1);
for better code readability. - Replace JUnit's
assertEqual()
assertion with AssertJassertThat().isEqualTo()
for improved readability and consistent use within the project.
solves #1474
@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.
@anyulled Thank you for signing the Contributor License Agreement!
@zyberzebra Who else needs to approve this pull request for merging it?
One of the Maintainers.