title: Register Extensions automatically in JUnit
body: <p>I am <em>extending</em> JUnit's <code>ParameterResolver</code> to provide a custom argument in Test methods.</p>
  
  <pre><code> public class MyParameterResolver implements ParameterResolver {
  
      @Override
      public boolean supportsParameter(ParameterContext parameterContext,
              ExtensionContext extensionContext) throws ParameterResolutionException {
          return parameterContext.getParameter().getType() == MyWrapper.class;
      }
  
      @Override
      public Object resolveParameter(ParameterContext parameterContext,
              ExtensionContext extensionContext) throws ParameterResolutionException {
  
          // Do something about getting MyAnnotation
  
          return new MyWrapper();
      }
  
  }
  </code></pre>
  
  <p>and then using it in test methods using <code>ExtendWith</code></p>
  
  <pre><code>@ExtendWith(MyParameterResolver.class)
  @Test
  @MyAnnotation(val = 20)
  @MyAnnotation(val = 30)    
  void test(MyWrapper wrapper) {
      System.out.println(wrapper);
  }
  </code></pre>
  
  <p>It works perfectly however I do not like the idea that all the tests which needs this extension would need to be annotated with <code>@ExtendWith(MyParameterResolver.class)</code> , is it possible to automatically register the annotation in Junit programmatically whenever a test method contains <code>MyWrapper</code> parameter or <code>MyAnnotation</code> annotation?</p>