You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2025/02/01 22:47:00 UTC

[jira] [Created] (ARTEMIS-5291) Simplify assertions

Justin Bertram created ARTEMIS-5291:
---------------------------------------

             Summary: Simplify assertions
                 Key: ARTEMIS-5291
                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5291
             Project: ActiveMQ Artemis
          Issue Type: Sub-task
            Reporter: Justin Bertram
            Assignee: Justin Bertram


Lots of tests contain assertions that can be simplified. The simplified assertions increase code readability and produce clearer error messages when they fail. Here are some examples:
||Example||Replacement||
|{{assertEquals(true, x());}}|{{assertTrue(x());}}|
|{{assertTrue(y() != null);}}|{{assertNotNull(y());}}|
|{{assertTrue(z == z());}}|{{assertSame(z, z());}}|
|{{assertTrue(a.equals(a()));}}|{{assertEquals(a, a());}}|
|{{assertTrue(false);}}|{{fail();}}|



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@activemq.apache.org
For additional commands, e-mail: issues-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact