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

Only invoke public no args callbacks in Arquillian testing #34031

Merged
merged 1 commit into from
Jun 19, 2023

Conversation

radcortez
Copy link
Member

No description provided.

@quarkus-bot
Copy link

quarkus-bot bot commented Jun 14, 2023

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

@@ -23,7 +23,9 @@ static void invokeJunitBefores(String className, Object testInstance)
collectCallbacks(testInstance.getClass(), befores, (Class<? extends Annotation>) testInstance.getClass()
.getClassLoader().loadClass(className));
for (Method before : befores) {
before.invoke(testInstance);
if (before.canAccess(testInstance) && before.getParameters().length == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we shouldn't log why Before and After methods were not invoked when this returns false

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is not ideal, but it is just an easy fix to run the JAX-RS TCK. Annotated methods can declare parameters resolvable by JUnit ParameterResolvers.. In such cases, we will fail. This fix will ignore such methods, but we need a more permanent solution.

@radcortez radcortez merged commit 7b5daab into quarkusio:main Jun 19, 2023
@quarkus-bot quarkus-bot bot added this to the 3.2 - main milestone Jun 19, 2023
@radcortez radcortez deleted the arquillian-callbacks branch July 5, 2023 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants