Spring boot gradle plugin forces Mockito version
Your main
project has Spring Boot's plugin applied to it, so it's using Spring Boot's dependency management. That means it will, by default, use Spring Boot's preferred version of Mockito, irrespective of the version specificied in test-utils
.
As described in the documentation, you can override the version of a dependency that Spring Boot manages by setting the relevant property. For Mockito that property is mockito.version
. Add the following to your main
project:
ext['mockito.version'] = '2.0.41-beta'