InjectMocks
InjectMocks is a feature of the Mockito testing framework used in unit tests for Java. It marks the class under test so that Mockito will create an instance of that class and automatically inject its dependencies with mock objects defined in the test.
In a typical setup, fields in the test are annotated with @Mock or @Spy to create mock
Initialization of the annotated fields requires enabling Mockito’s annotation processing. This can be done with the
Limitations and considerations include that injection relies on available mocks that match the dependencies of the