kgyrtkirk commented on code in PR #16382:
URL: https://github.com/apache/druid/pull/16382#discussion_r1592472051


##########
sql/src/test/java/org/apache/druid/sql/calcite/SqlTestFrameworkConfig.java:
##########
@@ -169,40 +280,25 @@ public void afterAll(ExtensionContext context)
     @Override
     public void beforeEach(ExtensionContext context)
     {
-      method = context.getTestMethod().get();
-      setConfig(method.getAnnotation(SqlTestFrameworkConfig.class));
+      setConfig(context);
     }
 
-    @SqlTestFrameworkConfig
-    public SqlTestFrameworkConfig defaultConfig()
+    private void setConfig(ExtensionContext context)
     {
-      try {
-        SqlTestFrameworkConfig annotation = getClass()
-            .getMethod("defaultConfig")
-            .getAnnotation(SqlTestFrameworkConfig.class);
-        return annotation;
-      }
-      catch (NoSuchMethodException | SecurityException e) {
-        throw new RuntimeException(e);
-      }
-    }
-
-    private void setConfig(SqlTestFrameworkConfig annotation)
-    {
-      if (annotation == null) {
-        annotation = defaultConfig();
-      }
-      config = new SqlTestFrameworkConfigInstance(annotation);
+      method = context.getTestMethod().get();
+      Class<?> testClass = context.getTestClass().get();
+      List<Annotation> annotations = collectAnnotations(testClass, method);
+      config = new SqlTestFrameworkConfig(annotations);
     }
 
-    public SqlTestFrameworkConfigInstance getConfig()
+    public SqlTestFrameworkConfig getConfig()
     {
       return config;
     }
 
-    public SqlTestFramework get()
+    public SqlTestFramework get() throws Exception
     {
-      return configStore.getConfigurationInstance(config, 
testHostSupplier).framework;
+      return configStore.getConfigurationInstance(config, x -> x).framework;

Review Comment:
   The `AvaticaServer` related things are added by wrapping the supplier with a 
delegate; in normal operation that's not needed.
   I think that could be removed later - as it would be better to package that 
part into a module or something



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to