You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Otavio Rodolfo Piske (Jira)" <ji...@apache.org> on 2023/06/28 08:59:00 UTC

[jira] [Updated] (CAMEL-19557) camel-core: ensure tests have assertions

     [ https://issues.apache.org/jira/browse/CAMEL-19557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Otavio Rodolfo Piske updated CAMEL-19557:
-----------------------------------------
    Component/s: camel-core
                     (was: camel-dhis2)

> camel-core: ensure tests have assertions
> ----------------------------------------
>
>                 Key: CAMEL-19557
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19557
>             Project: Camel
>          Issue Type: Task
>          Components: camel-core, tests
>    Affects Versions: 4.0.0
>            Reporter: Otavio Rodolfo Piske
>            Priority: Minor
>              Labels: easy, help-wanted
>
> Some tests do not have assertions and that prevents us from fully understanding what is a test failure and what is an error. In many cases, these are tests that were originally written with older versions of JUnit in mind (i.e: equal or older than v4), so they lack modernization.
>  
> We should ensure every test has an assertion. The assertion does not, necessarily, needs to be visible (i.e.: it can be called in a separate method).
>  
> When asserting that a piece of code does not throw an error, we should use JUnit's 5 [assertDoesNotThrow|https://junit.org/junit5/docs/5.8.2/api/org.junit.jupiter.api/org/junit/jupiter/api/Assertions.html#assertDoesNotThrow(org.junit.jupiter.api.function.Executable)] (either the linked method or one of the others with different signatures).
>  
>  



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