Rate This Document
Findability
Accuracy
Completeness
Readability

Error: Mockito's inline mock maker is not supported

Symptom

A test case fails to be executed and an error is reported. See Figure 1.
Figure 1 Mock failure

Possible Causes

The mockito-inline library is missing in the pom.xml file.

Troubleshooting Procedure

Add the mockito-inline library to the pom.xml file.
1
2
3
4
5
6
<dependency>
    <groupId>org.mockito</groupId>
    <artifactId>mockito-inline</artifactId>
    <version>3.9.0</version>
    <scope>test</scope>
</dependency>

The added mockito-inline library version must be compatible with the project.