Code review comment: (Probably not directly, as there's no `ParameterContext` here, but ... somehow keep the two places in sync?)

Code before review:
QuarkusComponentTestConfiguration update(Class<?> testClass) {
Map<String, String> configProperties = new HashMap<>(this.configProperties);
List<Class<?>> componentClasses = new ArrayList<>(this.componentClasses);
boolean useDefaultConfigProperties = this.useDefaultConfigProperties;
boolean addNestedClassesAsComponents = this.addNestedClassesAsComponents;
int configSourceOrdinal = this.configSourceOrdinal;
List<AnnotationsTransformer> annotationsTransformers = new ArrayList<>(this.annotationsTransformers);
QuarkusComponentTest testAnnotation = testClass.getAnnotation(QuarkusComponentTest.class);
if (testAnnotation != null) {
Collections.addAll(componentClasses, testAnnotation.value());
useDefaultConfigProperties = testAnnotation.useDefaultConfigProperties();
addNestedClassesAsComponents = testAnnotation.addNestedClassesAsComponents();
configSourceOrdinal = testAnnotation.configSourceOrdinal();
Class<? extends AnnotationsTransformer>[] transformers = testAnnotation.annotationsTransformers();
if (transformers.length > 0) {
for (Class<? extends AnnotationsTransformer> transformerClass : transformers) {
try {
annotationsTransformers.add(transformerClass.getDeclaredConstructor().newInstance());
} catch (Exception e) {
LOG.errorf("Unable to instantiate %s", transformerClass);
}
}
}
}
Class<?> current = testClass;
while (current != null && current != Object.class) {
for (Field field : current.getDeclaredFields()) {
if (field.isAnnotationPresent(Inject.class) && !resolvesToBuiltinBean(field.getType())) {
componentClasses.add(field.getType());
}
}
if (addNestedClassesAsComponents) {
for (Class<?> declaredClass : current.getDeclaredClasses()) {
if (Modifier.isStatic(declaredClass.getModifiers())) {
componentClasses.add(declaredClass);
}
}
}
for (Method method : current.getDeclaredMethods()) {
if (method.isAnnotationPresent(Test.class)) {
for (Parameter param : method.getParameters()) {
if (param.getType() == TestInfo.class
|| param.isAnnotationPresent(InjectMock.class)
|| param.isAnnotationPresent(SkipInject.class)) {
continue;
}
componentClasses.add(param.getType());
}
}
}
current = current.getSuperclass();
}
List<TestConfigProperty> testConfigProperties = new ArrayList<>();
Collections.addAll(testConfigProperties, testClass.getAnnotationsByType(TestConfigProperty.class));
for (TestConfigProperty testConfigProperty : testConfigProperties) {
configProperties.put(testConfigProperty.key(), testConfigProperty.value());
}
return new QuarkusComponentTestConfiguration(Map.copyOf(configProperties), List.copyOf(componentClasses),
this.mockConfigurators,
useDefaultConfigProperties, addNestedClassesAsComponents, configSourceOrdinal,
List.copyOf(annotationsTransformers));
}

Line under review: if (param.getType() == TestInfo.class

Code after addressing the review:
QuarkusComponentTestConfiguration update(Class<?> testClass) {
Map<String, String> configProperties = new HashMap<>(this.configProperties);
List<Class<?>> componentClasses = new ArrayList<>(this.componentClasses);
boolean useDefaultConfigProperties = this.useDefaultConfigProperties;
boolean addNestedClassesAsComponents = this.addNestedClassesAsComponents;
int configSourceOrdinal = this.configSourceOrdinal;
List<AnnotationsTransformer> annotationsTransformers = new ArrayList<>(this.annotationsTransformers);
QuarkusComponentTest testAnnotation = testClass.getAnnotation(QuarkusComponentTest.class);
if (testAnnotation != null) {
Collections.addAll(componentClasses, testAnnotation.value());
useDefaultConfigProperties = testAnnotation.useDefaultConfigProperties();
addNestedClassesAsComponents = testAnnotation.addNestedClassesAsComponents();
configSourceOrdinal = testAnnotation.configSourceOrdinal();
Class<? extends AnnotationsTransformer>[] transformers = testAnnotation.annotationsTransformers();
if (transformers.length > 0) {
for (Class<? extends AnnotationsTransformer> transformerClass : transformers) {
try {
annotationsTransformers.add(transformerClass.getDeclaredConstructor().newInstance());
} catch (Exception e) {
LOG.errorf("Unable to instantiate %s", transformerClass);
}
}
}
}
Class<?> current = testClass;
while (current != null && current != Object.class) {
for (Field field : current.getDeclaredFields()) {
if (field.isAnnotationPresent(Inject.class) && !resolvesToBuiltinBean(field.getType())) {
componentClasses.add(field.getType());
}
}
if (addNestedClassesAsComponents) {
for (Class<?> declaredClass : current.getDeclaredClasses()) {
if (Modifier.isStatic(declaredClass.getModifiers())) {
componentClasses.add(declaredClass);
}
}
}
for (Method method : current.getDeclaredMethods()) {
if (method.isAnnotationPresent(Test.class)) {
for (Parameter param : method.getParameters()) {
if (QuarkusComponentTestExtension.BUILTIN_PARAMETER.test(param)
|| param.isAnnotationPresent(InjectMock.class)
|| param.isAnnotationPresent(SkipInject.class)) {
continue;
}
componentClasses.add(param.getType());
}
}
}
current = current.getSuperclass();
}
List<TestConfigProperty> testConfigProperties = new ArrayList<>();
Collections.addAll(testConfigProperties, testClass.getAnnotationsByType(TestConfigProperty.class));
for (TestConfigProperty testConfigProperty : testConfigProperties) {
configProperties.put(testConfigProperty.key(), testConfigProperty.value());
}
return new QuarkusComponentTestConfiguration(Map.copyOf(configProperties), List.copyOf(componentClasses),
this.mockConfigurators,
useDefaultConfigProperties, addNestedClassesAsComponents, configSourceOrdinal,
List.copyOf(annotationsTransformers));
}