Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 888
Girdhar Singh Rathore Avatar asked Oct 12 '15 08:10

Girdhar Singh Rathore


1 Answers

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

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

like image 187
robin Avatar answered Sep 25 '22 13:09

robin