If you are using powermock ensure that your dependencies point to:
org.powermock:powermock-api-mockito2
instead of
org.powermock:powermock-api-mockito
More Related Contents:
- How to mock void methods with Mockito
- PowerMockito mock single static method and return object
- Use Mockito to mock some methods but not others
- Difference between @Mock and @InjectMocks
- Mockito – difference between doReturn() and when()
- How do Mockito matchers work?
- Why doesn’t Mockito mock static methods?
- Test class with a new() call in it with Mockito
- Initialising mock objects – MockIto
- How to use Mockito with JUnit5
- Testing Private method using mockito
- Mock a constructor with parameter
- Mockito : how to verify method was called on an object created within a method?
- Mockito: InvalidUseOfMatchersException
- Is it possible to use Mockito in Kotlin?
- How to use ArgumentCaptor for stubbing?
- Unit testing with mockito for constructors
- How to mock new Date() in java using Mockito
- Is it discouraged to use @Spy and @InjectMocks on the same field?
- Unfinished Stubbing Detected in Mockito
- Mockito, JUnit and Spring
- Mockito – @Spy vs @Mock
- Transactional annotation avoids services being mocked
- Mocking Logger and LoggerFactory with PowerMock and Mockito
- junit testing for user input using Scanner
- throw checked Exceptions from mocks with Mockito
- mocking a method that return generics with wildcard using mockito
- Mockito, @InjectMocks strange behaviour with final fields
- Integration tests for AspectJ
- How to mock a builder with mockito