You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MockitoTestNGListener does not close the session of before methods in case an exception is thrown in the before method. All follow-up tests will fail. This is a problem especially in test pipelines when you run 100s of tests. Finding the cause takes longer than necessary. In these scenarios it also appears that getting the class name from ITestResult returns null. This causes an NPE when calling hasMockitoTestNGListener.
I would propose the following solutions in the listener:
Hope this makes sense. I actually ran into the situation and applying these changes fixed it for me. With the fix I only see the tests from the same test class failing and not other tests afterwards as well.
The text was updated successfully, but these errors were encountered:
The MockitoTestNGListener does not close the session of before methods in case an exception is thrown in the before method. All follow-up tests will fail. This is a problem especially in test pipelines when you run 100s of tests. Finding the cause takes longer than necessary. In these scenarios it also appears that getting the class name from
ITestResult
returnsnull
. This causes an NPE when callinghasMockitoTestNGListener
.I would propose the following solutions in the listener:
Important part is to return true in
shouldBeRunAfterInvocation
in case an exception was thrown in the before method.Hope this makes sense. I actually ran into the situation and applying these changes fixed it for me. With the fix I only see the tests from the same test class failing and not other tests afterwards as well.
The text was updated successfully, but these errors were encountered: