Junit 5 doesn't require public test methods as in previous versions and some tools (e.g. IntelliJ) default them to being package private.
QuarkusUnitTest uses proxying to manage its test instance and the proxy requires public methods; without them the test methods are called on the proxy itself and not on the target. Noting this in the documentation would save some people quite a bit of hand wringing about why everything in the test appears null.
Alternatively, this restriction could be relaxed to match JUnit 5 (if that's possible).
Thanks for reporting @kdubb.
I'm curious, why do you want to use QuarkusUnitTest? Is there something in the documentation that lead you to want to use it?
I'm building extensions for Mybatis and Hazelcast. I was wracking my brain trying to figure out my testing failures until I noticed the proxying in the extension.
Thanks! I was just wanted to make sure you were indeed planning on creating an extension.
Would you like to add a note in the documentation and the javadoc?
I'm building extensions for
MybatisandHazelcast. I was wracking my brain trying to figure out my testing failures until I noticed the proxying in the extension.
It's not really related to the issue, but we developed the Hazelcast Client extension already(code). We're doing the last round of polishing now and the PR is about to go out in a few days
@pivovarit Awesome!! I've been concentrating on Mybatis so this is really great news. Thanks!
This will be fixed by the class loader changes. JUnit 5.6 does not require a proxy any more, as it lets you directly intercept the test invocation.
This should be fixed now.
Most helpful comment
It's not really related to the issue, but we developed the Hazelcast Client extension already(code). We're doing the last round of polishing now and the PR is about to go out in a few days