-
| 
         In the deprecated  @RunWith(CustomRunner.class)
public MyTest {
  // ...
}with public class CustomRunner extends JUnitPlatform {
  public CustomRunner(final Class<?> clazz)
      throws NoSuchFieldException, SecurityException, IllegalArgumentException,  IllegalAccessException {
    super(shadowTestClass(clazz));
  }
  // ...
  private static Class shadowTestClass(Class testClass) {
    return modified test class, poissibly with custom classloader;
  }
}I'm not quite sure it's possible to do the same using current JUnit feature set. From I found, in particular in  I've also seen this selector   | 
  
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
| 
         This sounds like a job for a custom test instance factory: https://docs.junit.org/current/user-guide/#extensions-test-instance-factories 
  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         To support your use case, you may be able to register a custom  Related Issues | 
  
Beta Was this translation helpful? Give feedback.
As a side note, if you're interested in support for a custom
ClassLoader, you really should search the open issues for discussions related to "ClassLoader" before starting a discussion.