Method threw 'org.mockito.exceptions.misusing.InvalidUseOfMatchersException' exception. Cannot evaluate XXXDAO$$EnhancerByMockitoWithCGLIB$$30e37a7a.toString()
原因:
List<Object> list = new ArrayList<>();
when(dao.test(any(Student.class))).thenReturn(list);
do not mixed matchers and values
should use one matchers and one values
like this:
Student s = spy(Student.class);
when(dao.test(s)).thenReturn(list);