Mocking in IntelliJ?


Help please! we need to make a decision based on current version answer.

I switched ALL our developers in my company to IntelliJ from Eclipse. it took some time and lots of convincing. I raved about jetbrains and everything they do in any platform. 2 months later now I found this hopefully unupdated post from 2 years ago..

  • We do not provide a recommended approach to mocking. We have a few tests in our codebase that use JMock, but in general we find it difficult to mock all of the interactions with IntelliJ Platform components that your plugin class will need to have, and we recommend working with real components instead.

PLEASE tell me that intelliJ has forsaken this ridiculous philosophy of no mocking. You cant TDD with no Mocks. and we definitely don't have the time to create Mocks ourselves. I'm pretty shocked and disappointed, especially after the endless war of switching everyone from eclipse to IDEA,

I cant even find the JMock plugin mentioned above.

Assistance please! is there anyone with concurrent answer on this subject.

Thanks in advance

Comment actions Permalink

Maybe we can use mockito and powerMockito not as plugins? just import the lib and it will work? I cant even imagine why or how would  a specific IDE prevent the use of a testing lib. even if its not supported in the IDEA UI. 


Comment actions Permalink

This comment refers to internal testing of IntelliJ IDEA Platform inside JetBrains and has nothing to do with your own projects (if you are not developing a plug-in for IntelliJ IDEA).

You can of course use any mocking library in your own projects.

Comment actions Permalink

Hi Serge

I started to incorporate mockito and now adding power mock. The paragraph above really baffled me. I see now I misunderstood it. 

Thanks for your time.


If someone can delete this post he should;)


Please sign in to leave a comment.