79476298

Date: 2025-02-28 17:45:38
Score: 1
Natty:
Report link

According to the Junit documentation, the way to set a custom classloader for tests in Junit 5 is to create a LauncherInterceptor and configure it using by setting a system property e.g. in gradle:

test {
  systemProperty(”junit.platform.launcher.interceptors.enabled“, true)
  // ...
}

Then then LauncherInterceptor needs to be registered by adding it to /META-INF/services/org.junit.platform.launcher.LauncherDiscoveryListener

Reasons:
  • Contains signature (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Per