I get the following error when a void breaks:
Method when (T) in Stubber type is not applicable for arguments (void)
Here is my sample code:
doNothing().when(mockRegistrationPeristImpl.create(any(Registration.class))); public void create(final T record) throws DataAccessException { try { entityManager.persist(record); entityManager.flush(); } catch (PersistenceException ex) {} }
What am I missing?
mockito
user3123934
source share