[Feature] Reduce the amount of assertTrue/False statements #1762
Labels
enhancement
New feature or request
test fix
test fixes
triaged
Issues labeled as 'Triaged' have been reviewed and are deemed actionable.
From #1758 (comment)
There are 1774
Assert.assertTrue(...)
and and 601Assert.assertFalse(...)
statements in this codebase that are not very useful for debugging test failures. We should transition to alternatives that make test failures easier to diagnose and make tests more readable.Consider a test case structured like this:
If there was a failure in this scenario it would look like
It would be much better if the test was structured in a way that made it clearer what was wrong such as an error like
org.opentest4j.AssertionFailedError: expected: <HttpStatusCode.Forbidden> but was: <HttpStatusCode.NotFound>
The text was updated successfully, but these errors were encountered: