mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
With JUnit Jupiter it is still not possible to set the ClassLoader for loading the test class.
Therefore, use the ModifiedClassLoaderExtension (heavily inspired by the Spring Boot bde7bd0a1a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtension.java
).
Once JUnit Jupiter 201 is resolved we can simplify this.
With this extension we can catch all the tests in a class and then run them once the Class Extension Store gets closed with a modified ClassLoader.
The CompilationCache is stored in the GlobalCache with the CompilationRequest as key.
This means that even when methods are not executed in some particular order if they have same WithClasses
then they would reuse the cache.