Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mockito JUnit extension breaks with Mockito 5.12 #2409

Closed
mp911de opened this issue Aug 8, 2024 · 0 comments
Closed

Mockito JUnit extension breaks with Mockito 5.12 #2409

mp911de opened this issue Aug 8, 2024 · 0 comments
Labels
type: bug A general bug

Comments

@mp911de
Copy link
Member

mp911de commented Aug 8, 2024

org.mockito.exceptions.misusing.UnfinishedMockingSessionException: 
10:02:02  
10:02:02  Unfinished mocking session detected.
10:02:02  Previous MockitoSession was not concluded with 'finishMocking()'.
10:02:02  For examples of correct usage see javadoc for MockitoSession class.
10:02:02  	at org.mockito.junit.jupiter.MockitoExtension.beforeEach(MockitoExtension.java:160)
10:02:02  	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
10:02:02  	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
10:02:02  	Suppressed: java.lang.NullPointerException: Cannot invoke "java.util.Set.forEach(java.util.function.Consumer)" because the return value of "org.junit.jupiter.api.extension.ExtensionContext$Store.remove(Object, java.lang.Class)" is null
10:02:02  		at org.mockito.junit.jupiter.MockitoExtension.afterEach(MockitoExtension.java:194)
10:02:02  		... 2 more
10:02:02  

We should use a manual mocking setup until the issue mockito/mockito#3411 is fixed.

@mp911de mp911de added the type: bug A general bug label Aug 8, 2024
@mp911de mp911de closed this as completed in d294109 Aug 8, 2024
@mp911de mp911de added this to the 4.2.9 (2023.1.9) milestone Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant