You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 3, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 3, 2025. It is now read-only.
Should we replace most of the PowerMocking with singleton patterns? #380
Another way to get rid of staticness of the TmcUtil and the SettingsIo would be to add
getters for them in CliContext. Which could be replaced with Mockito spying or giving them
in the constructor.
Third way to fix the static classes could be dependency injection library like Guice,
but I don't have a clue how to integrate it easily into our project.
changed the title [-]Should we replace most of the PowerMocking with singleton pattern?[/-][+]Should we replace most of the PowerMocking with singleton patterns?[/+]on Jul 9, 2016
Is it really a good idea to replace static classes with instances? I thought we were moving away from this when I refactored SettingsIo and CourseInfoIo.
The unit testing of static classes is bit of a pain. But we have now tests for nearly all of the code so It would take lot of time to change the unit tests. And I think there is more important stuff to be done here.
Also I unit tested some non-static util methods and their testing wasn't as easy as I would have hoped.
Activity
[-]Should we replace most of the PowerMocking with singleton pattern?[/-][+]Should we replace most of the PowerMocking with singleton patterns?[/+]jclc commentedon Jul 10, 2016
Is it really a good idea to replace static classes with instances? I thought we were moving away from this when I refactored SettingsIo and CourseInfoIo.
Salmela commentedon Jul 10, 2016
The unit testing of static classes is bit of a pain. But we have now tests for nearly all of the code so It would take lot of time to change the unit tests. And I think there is more important stuff to be done here.
Also I unit tested some non-static util methods and their testing wasn't as easy as I would have hoped.