Issue
I am experiencing a problem I hope you can help with.
I want to use Mockito in my Spring Boot w/Gradle project, but STS cannot resolve the dependancy.
I have the following in my build.gradle
file;
repositories { jcenter() }
dependencies { testCompile('org.mockito:mockito-core:1.+') }
When I do a ./gradlew --info build
I can see that it is resolving Mockito:
Resolved versions: {org.mockito:mockito-core=1.+}
Using version '1.+' for dependency 'org.mockito:mockito-core:1.+'
Using version '1.+' for dependency 'org.mockito:mockito-core:1.10.19'
After a ./gradlew cleanEclipse eclipse
it is in my STS Project's Build Path
My Code File is showing the following message:
I have another project, setup in exactly the same way and it is working fine.
Please help me out guys, Luke.
Solution
Use with a static import:
import static org.mockito.Mockito.when; ...or...
import static org.mockito.Mockito.*;
Answered By - user6011162