sigee commented on PR #276:
URL: 
https://github.com/apache/commons-beanutils/pull/276#issuecomment-2316127771

   @F0otman 
   Typically, logging is not a feature you have to test, but with this change, 
you put a little "business logic" into it.
   
   About the test writing. You are right, it is a bit complicated because the 
code may not be in a testable format.
   "Never hide a TUF within a TUC."
   TUF - Test Unfriendly Feature
   - a piece of functionality embodied in code, which makes unit testing 
difficult
   - database access
   - filesystem access
   - network access
   - static variable usage
   
   TUC - Test Unfriendly Construct
   - final methods
   - final classes
   - static methods
   - private methods
   - static initialization expressions
   
   I'll think about it and will be back tomorrow.
   Maybe a small refactor (create a constructor where you can inject a LOG) and 
you can assert the LOG.trace() was called with the expected parameter.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to