Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mockito methods are not accessible

Tags:

mockito

I have mockito setup on my project with this maven lines:

<dependency>
    <groupId>org.mockito</groupId>
    <artifactId>mockito-all</artifactId>
    <version>1.8.5</version>
    <scope>test</scope>
</dependency>

I have no problems to use the @Mock annotation but I can't access and use mockito methods like:

when(someMock.someMethod()).thenReturn();

Eclipse just does not recognize them.

Please help.

like image 720
Ido Barash Avatar asked Dec 30 '12 09:12

Ido Barash


1 Answers

Kotlin syntax - dont forget the ` ` backticks:

import org.mockito.Mockito.`when`


`when`(someMock.someMethod()).thenReturn();
like image 118
SilverTech Avatar answered Oct 19 '22 07:10

SilverTech