I\'m writing unit tests now. I need to simulate long-run method with Mockito to test my implementation\'s timeout handling. Is it possible with Mockito?
Something li
From mockito 2.8.44, org.mockito.internal.stubbing.answers.AnswersWithDelay is available for this purpose. Here's a sample usage
doAnswer( new AnswersWithDelay( 1000, new Returns("some-return-value")) ).when(myMock).myMockMethod();