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 has been archived by the owner on Nov 6, 2022. It is now read-only.
Currently the SessionManager uses static methods via an enum class / singleton model.
Mockito on its own can't mock the methods so testing things which uses the SessionManager is impossible. One workaround is to use PowerMockito, however, it requires Junit4, and everything now is setup to use Junit5 (Jupiter). PowerMockito does not work on Junit5, and tickets have been stalled since 2016:
So, I'm not confident it will be fixed in any short order, making the fastest solution be a refactor which no longer uses the enum singleton model.
This might be a good time to also introduce dependency injection properly since it will likely require the SessionManager or something to be included in any class which uses it.
The text was updated successfully, but these errors were encountered:
Currently the
SessionManager
uses static methods via an enum class / singleton model.Mockito on its own can't mock the methods so testing things which uses the SessionManager is impossible. One workaround is to use PowerMockito, however, it requires Junit4, and everything now is setup to use Junit5 (Jupiter). PowerMockito does not work on Junit5, and tickets have been stalled since 2016:
It seems to be that the junit5 team won't add support for whats needed to do it, robo electric is having a similar problem:
which is stuck on teh same issue in junit5.
So, I'm not confident it will be fixed in any short order, making the fastest solution be a refactor which no longer uses the enum singleton model.
This might be a good time to also introduce dependency injection properly since it will likely require the SessionManager or something to be included in any class which uses it.
The text was updated successfully, but these errors were encountered: