camunda / camunda-bpm-platform

Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Quarkus, Spring, Spring Boot, CDI.
https://camunda.com/
Apache License 2.0
4.11k stars 1.55k forks source link

JUnit 5 test extension doesn't resolve package-private test methods #2789

Closed ThorbenLindhauer closed 1 year ago

ThorbenLindhauer commented 2 years ago

This issue was imported from JIRA:

Field Value
JIRA Link CAM-14872
Reporter 8YK8zP
What is this name? This pseudonym name was generated based on the user name in JIRA to protect the personal data of our JIRA users. You can use this identifier to search for issues by the same reporter.
Has restricted visibility comments false

Observed Behavior

org.camunda.bpm.engine.impl.test.TestHelper.getMethod(...) retrieves only public methods for a given method name and its parameters.

Expected behavior

org.camunda.bpm.engine.impl.test.TestHelper.getMethod(...) should retrieve all declared methods for a given method name and its parameters

Root Cause

org.camunda.bpm.engine.impl.test.TestHelper.getMethod(...) calls

clazz.getMethod(methodName, parameterTypes);

Solution Idea

org.camunda.bpm.engine.impl.test.TestHelper.getMethod(...) should call 

clazz.getDeclaredMethod(methodName, parameterTypes);

Links

-

Breakdown

p-wunderlich commented 1 year ago

Please fix this Issues as soon as possible. Since sonar tells us to remove the public access modifier from JUnit 5 tests, it's quite normal that the public modifier will get removed from all (camunda) tests during upgrade to Junit 5.

So I guess a lot of people will run into this issue. And it was not that easy to find out what's the problem here is. (Because the Test just says "no process deployed" ....)

tasso94 commented 1 year ago

Hi @pschalk,

Thank you for making us aware of this problem.

Are you interested in contributing the fix to our code base?

Best, Tassilo