Mock annotation not known in my IDE

Hi all,
tried to create a simple test using @Mock annotation but dependencies were not found by my IDE (Eclipse). Is there any additional configuration needed for this to work or it’s supposed to work outside of the box?


Yes it should work out of the box. There are several bindings that use it. You might check what they use.

Make sure you add mockito dependency into POM.xml:


As long as your test is plain old unit test which does not bother with bnd and/or osgi it should be just fine.


That should not be needed. For example the tplinksmarthome binding uses mock any hasn’t any dependency in the pom.xml

Right, I forgot that it is inherited from binding parent pom.