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

Document/Fix QuarkusUnitTest's public method requirement #6652

Closed
kdubb opened this issue Jan 20, 2020 · 7 comments
Closed

Document/Fix QuarkusUnitTest's public method requirement #6652

kdubb opened this issue Jan 20, 2020 · 7 comments
Assignees
Milestone

Comments

@kdubb
Copy link
Contributor

kdubb commented Jan 20, 2020

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).

@geoand
Copy link
Contributor

geoand commented Jan 20, 2020

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?

@kdubb
Copy link
Contributor Author

kdubb commented Jan 20, 2020

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.

@geoand
Copy link
Contributor

geoand commented Jan 20, 2020

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?

@pivovarit
Copy link
Contributor

pivovarit commented Jan 21, 2020

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.

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

@kdubb
Copy link
Contributor Author

kdubb commented Jan 21, 2020

@pivovarit Awesome!! I've been concentrating on Mybatis so this is really great news. Thanks!

@stuartwdouglas
Copy link
Member

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.

@stuartwdouglas stuartwdouglas added this to the 1.3.0.Final milestone Mar 12, 2020
@stuartwdouglas
Copy link
Member

This should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants