I need to mock a call to the findById method of the GenericService.
I've this:
public class UserServiceImpl extends GenericServiceImpl<User Integer> implements UserService, Serializable {
....
// This call i want mock
user = findById(user.getId());
.....
// For example this one calls mockeo well. Why is not it a call to the generic service?
book = bookService.findById(id);
The problem is in the first mock since it is a call to a generic service.
The second mock works fine as well
when(bookService.findById(anyInt())).thenReturn(mockedBook);