Skip to content
Advertisement

The type MockitoAnnotations.Mock is deprecated

I am mocking a object using @Mock annotation

@Mock
Customer customer;

but the @Mock annotation is showing warning

The type MockitoAnnotations.Mock is deprecated

and my test case is failed

Advertisement

Answer

You are using the wrong mock. Try using the below one

org.mockito.Mock instead of org.mockito.MockitoAnnotations.Mock

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement