-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Cannot mock/spy class error, after adding quarkus-junit5-mockito dependency #37927
Comments
/cc @geoand (testing) |
The problem is that Quarkus 3.x is fixating the old FTR, this also happens with Java 17. @geoand are you planning on supporting the default |
@famod unfortunately exclusion of |
Right, we'll have to tackle the memory leak at some point and support |
FWIW, I was just hit by subclass mock maker limitations when trying to So +1 (again) to move on to |
Could we install a callback somewhere to clean the mocks after test execution? |
+1 to the addition in the Testing Guide. Although googling the error can lead you to #32952 (comment) (or the migration guide), new users aren't expected to read Migration guides when creating apps directly on Quarkus 3, right? 🤔 |
I opened #46119 to fix this, however I could not find a way to reproduce the original issue with OOM error so I don't know if the change reintroduces it or not... |
Should we make sure we call Not sure if it's still needed though. I think we should probably bite the bullet and adjust if we have reports. A lot of things changed since 3.0.0. |
That's essentially what the PR does.
Right. I'm like +0.5 on that. I still wish I could have reproduced the original issue though... |
Ah yes sorry. Not my best self right now. |
No worries :) |
Use inline strategy for Mockito instead of subclass one
Describe the bug
After adding
quarkus-junit5-mockito
dependency, tests start to fail withCannot mock/spy class
errorExpected behavior
Test should work
Actual behavior
Tests fail
How to Reproduce?
con-testing.tar.gz
./mvnw quarkus:dev
and pressr
to start testingquarkus-junit5-mockito
is removed with the test using@InjectMock
, the failing tests become greenOutput of
uname -a
orver
No response
Output of
java -version
openjdk version "21.0.1" 2023-10-17 LTS Corretto-21.0.1.12.1 (build 21.0.1+12-LTS)
Quarkus version or git rev
5.6.4
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.6
Additional information
No response
The text was updated successfully, but these errors were encountered: