- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
https://thedailywtf.com/articles/The_Brillant_Paula_Bean
Admin
Apparently someone planned to inject a CensusDao int the bean, but then decided it's not needed and forgot to remove the setter.
Admin
The unit tests will continue as long as bad copy/paste gets into the code.
Admin
I suppose it could have been worse if they decided to return a value...
Admin
Dependency inception: Your bean is the scene of the WTF.
Admin
The unit tests are created by copy/paste as well.
Admin
But it works in the one-off case where CensusDao.BEAN_NAME==reportDatesDao, and if you use that as the only test then unit tests will pass.
This is, indeed, Brillant!!