You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "Taher-Ghaleb (via GitHub)" <gi...@apache.org> on 2023/08/21 06:01:01 UTC

[GitHub] [camel] Taher-Ghaleb opened a new pull request, #11156: Refactor assertTrue(!) with assertFalse & Add explanatory messages

Taher-Ghaleb opened a new pull request, #11156:
URL: https://github.com/apache/camel/pull/11156

   I am working on research that investigates test smell refactoring in which we identify alternative implementations of test cases, study how commonly used these refactorings are, and assess how acceptable they are in practice.
   
   The first smell is when inappropriate assertions are used, while there exist better alternatives. For example, in [RawMailMessageTest.java](https://github.com/apache/camel/commit/f777f422ea24b21022a89d6a425f5ed0f211b8ea#diff-04960f3b28d9765e85f40286d286eee23603cb949def41f69a79b7af1a65fb0a), I refactored `assertTrue(!headers.isEmpty());` using `assertFalse(headers.isEmpty());` instead.
   
   The second smell is known as Assertion Roulette, where a test method has multiple asserts and some or all of them have no explanatory messages, which can sometimes make it difficult to identify which assert has failed. Therefore, I made all asserts in the test methods in [RawMailMessageTest.java](https://github.com/apache/camel/commit/f777f422ea24b21022a89d6a425f5ed0f211b8ea#diff-04960f3b28d9765e85f40286d286eee23603cb949def41f69a79b7af1a65fb0a) have exploratory messages.
   
   I would like to get your feedback on these particular test smells and their refactorings. Thanks in advance for your input.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #11156: Refactor assertTrue(!) with assertFalse & Add explanatory messages

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #11156:
URL: https://github.com/apache/camel/pull/11156#issuecomment-1685701070

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :camel: Maintainers, please note that first-time contributors *require manual approval* for the GitHub Actions to run.
   
   :warning: Please note that the changes on this PR may be **tested automatically** if they change components.
   
   :robot: Use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot.
   
   If necessary Apache Camel Committers may access logs and test results in the job summaries!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske commented on pull request #11156: Refactor assertTrue(!) with assertFalse & Add explanatory messages

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on PR #11156:
URL: https://github.com/apache/camel/pull/11156#issuecomment-1686152695

   [build 6.log](https://github.com/apache/camel/files/12395457/build.6.log)
   
   There are build errors that need to be reviewed


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] Taher-Ghaleb commented on pull request #11156: Refactor assertTrue(!) with assertFalse & Add explanatory messages

Posted by "Taher-Ghaleb (via GitHub)" <gi...@apache.org>.
Taher-Ghaleb commented on PR #11156:
URL: https://github.com/apache/camel/pull/11156#issuecomment-1686480811

   Thanks for your response and for merging, @orpiske. I appreciate it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske merged pull request #11156: Refactor assertTrue(!) with assertFalse & Add explanatory messages

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske merged PR #11156:
URL: https://github.com/apache/camel/pull/11156


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] orpiske commented on pull request #11156: Refactor assertTrue(!) with assertFalse & Add explanatory messages

Posted by "orpiske (via GitHub)" <gi...@apache.org>.
orpiske commented on PR #11156:
URL: https://github.com/apache/camel/pull/11156#issuecomment-1685858173

   @Taher-Ghaleb thanks for your contribution cleaning up our tests. We love those!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org