CodeQL library for Java
Search

Module Mockito

Provides classes and predicates for identifying use of the Mockito mocking framework.

QL classes are provided for detecting uses of Mockito annotations on fields.

Import path

import semmle.code.java.frameworks.Mockito

Imports

java

Provides all default Java QL imports.

Classes

MockitoAnnotatedField

A field which has a Mockito annotation.

MockitoAnnotation

A Mockito annotation.

MockitoExclusiveAnnotation

Only one of these annotations should be applied to a field.

MockitoInitMocks

The MockitoAnnotations.initMock(Object) method, which can be called to initialise Mockito annotated fields on the given object.

MockitoInitedTest

A class where the Mockito annotated fields have been initialized.

MockitoInjectedField

A field annotated with @InjectMocks.

MockitoMockInjectedClass

A class which is referenced by an @InjectMocks field.

MockitoMockMethod
MockitoMockableType

A type that can be mocked by Mockito.

MockitoMockedField

A field annotated with the Mockito @Mock annotation, indicating the field will be mocked.

MockitoMockedObject
MockitoSettableField

A field in a MockitoMockInjectedClass that can be set by mockito, either directly or indirectly through a setter method.

MockitoSpiedField

A field annotated with the Mockito @Spy annotation.

MockitoVerifiedMethodAccess

A MethodAccess which is called as part of a Mockito verification setup.

MockitoVerifyMethod

A verify method in a mockito class.