tkalkirill commented on a change in pull request #694:
URL: https://github.com/apache/ignite-3/pull/694#discussion_r816551812
##########
File path:
modules/configuration/src/test/java/org/apache/ignite/internal/configuration/testframework/ConfigurationExtension.java
##########
@@ -255,27 +292,79 @@ public long notificationCount() {
return cfgRef.get();
}
- /**
- * Looks for the annotated field inside the given test class.
- *
- * @return Annotated fields.
- */
- private static List<Field> getMatchingFields(Class<?> testClass) {
+ private static List<Field> getInjectConfigurationFields(Class<?>
testClass) {
return AnnotationSupport.findAnnotatedFields(
testClass,
InjectConfiguration.class,
- field -> supportType(field.getType()),
+ field -> isNameEndsWithConfiguration(field.getType()),
HierarchyTraversalMode.TOP_DOWN
);
}
+ private static List<Field> getInjectRevisionListenerHolderFields(Class<?>
testClass) {
+ return AnnotationSupport.findAnnotatedFields(
+ testClass,
+ InjectRevisionListenerHolder.class,
+ field -> isRevisionListenerHolder(field.getType()),
+ HierarchyTraversalMode.TOP_DOWN
+ );
+ }
+
+ private static boolean isNameEndsWithConfiguration(Class<?> type) {
+ return type.getCanonicalName().endsWith("Configuration");
+ }
+
+ private static boolean isRevisionListenerHolder(Class<?> type) {
+ return
ConfigurationStorageRevisionListenerHolder.class.isAssignableFrom(type);
+ }
+
/**
- * Checks that instance of the given class can be injected by the
extension.
- *
- * @param type Field or parameter type.
- * @return {@code true} if value of the given class can be injected.
+ * Implementation for {@link ConfigurationExtension}.
*/
- private static boolean supportType(Class<?> type) {
Review comment:
Name you suggested makes sense.
--
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]