Mockito is currently self-attaching to enable the inline-mock-maker. This will no longer work in future releases of the JDK I get this warning while testing in Spring Boot: