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?

Cheers,
Konstantin

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:

<dependency>
    <groupId>org.mockito</groupId>
    <artifactId>mockito-core</artifactId>
    <version>3.2.4</version>
    <scope>test</scope>
</dependency>

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

Best,
Łukasz

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.