I\'m trying to find a way to test my entity using Mockito;
This is the simple test method:
@Mock private EntityManager em; @Test public void persistArti
similar answer as above, but with lambdas
doAnswer((InvocationOnMock invocation) -> { Article article = (Article) invocation.getArguments()[0]; article.setId(1L); return null; }).when(em).persist(any(Article.class));