[
https://issues.jboss.org/browse/JBIDE-24375?page=com.atlassian.jira.plugi...
]
Dmitrii Bocharov commented on JBIDE-24375:
------------------------------------------
[~aurelien.pupier] powermock is used in several more places:
https://github.com/jbosstools/jbosstools-openshift/search?utf8=%E2%9C%93&...
I really don't want to remove PowerMockito. I spent 2 weeks in trying to create tests
from the link above without PowerMockito and without big refactoring of the existing code,
but i didn't succeed. The biggest difficulty is to test WatchManager - we had lots of
problem with it and it needed to be covered with tests, that's why i created it.
I 100% agree that code needs refactoring to be "testable", but the functionality
is very sensitive there, and i don't think it worth someone's else 2 weeks be
spent for refactoring. So if you really want to get rid of the PowerMockito at all and
have idea how to leave all the tests from the link working, i would be very glad to review
the PR :) (firstly i also had thoughts that it was easy, but when started coding tests -
bumped into lots of problems)
Remove PowerMock usage in tests
-------------------------------
Key: JBIDE-24375
URL:
https://issues.jboss.org/browse/JBIDE-24375
Project: Tools (JBoss Tools)
Issue Type: Task
Components: openshift
Affects Versions: 4.4.4.AM3
Reporter: Aurélien Pupier
I create this issue to gather ideas to get rid of it.
see
https://github.com/jbosstools/jbosstools-openshift/blob/cf544dbec4baa87c6...
from why i understand, PowerMock is used only to mock a singleton access in a static
method.
The reasonable seems to avoid static method: OpenShiftServerUtils. If we are using an
instanciation for this class, then, the call to create the Watcher can be extracted in a
method and this method would be classically mockable with Mockito.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)