Closed
Description
This bug was introduced in JUnit 5.7.1
. 5.7.0
have no such a problem.
Example:
Path baseDir = "/com/fasterxml/jackson/core/base/";
Path classFile = "/com/fasterxml/jackson/core/base/ParserMinimalBase.class";
String subpackageName = determineSubpackageName(baseDir, classFile);
// subpackageName now equals "...base"
The bug is probaby due to commit #2531 (Fix package path computation in ClasspathScanner )
I got this bug because I use ReflectionSupport#findAllClassesInPackage
inside my JUnit Jupiter plugin.
Steps to reproduce
To reproduce the bug is quite a trick. So project https://github.com/jlrosa/testwithresources was created. Here the steps to do
- Clone the project, execute
mvn clean install
, and open the project in IDE. - Setup a breakpoint in
ClasspathScanner#processClassFileSafely
line 131. - Run the test
InjectResourcesTest
in debug mode. - Java debugger will stop. Check the value of the variable
fullyQualifiedClassName
. It will be something like: "com.adelean.inject.resources.junit.jupiter....jupiter.WithJacksonMapper"
Context
- Used versions (Jupiter/Vintage/Platform): JUnit 5.7.1
- Build Tool/IDE: Intellij
Deliverables
- ...