Class ExtensionUtils
java.lang.Object
org.junit.jupiter.engine.descriptor.ExtensionUtils
Collection of utilities for working with extensions and the extension registry.
- Since:
- 5.1
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int(package private) static MutableExtensionRegistrypopulateNewExtensionRegistryFromExtendWithAnnotation(MutableExtensionRegistry parentRegistry, AnnotatedElement annotatedElement) Populate a newMutableExtensionRegistryfrom extension types declared via@ExtendWithon the suppliedAnnotatedElement.(package private) static voidregisterExtensionsFromFields(ExtensionRegistrar registrar, Class<?> clazz, Object instance) Register extensions in the supplied registry from fields in the supplied class that are annotated with@RegisterExtension.
-
Field Details
-
orderComparator
- Since:
- 5.4
-
-
Constructor Details
-
ExtensionUtils
private ExtensionUtils()
-
-
Method Details
-
populateNewExtensionRegistryFromExtendWithAnnotation
static MutableExtensionRegistry populateNewExtensionRegistryFromExtendWithAnnotation(MutableExtensionRegistry parentRegistry, AnnotatedElement annotatedElement) Populate a newMutableExtensionRegistryfrom extension types declared via@ExtendWithon the suppliedAnnotatedElement.- Parameters:
parentRegistry- the parent extension registry to set in the newly created registry; nevernullannotatedElement- the annotated element on which to search for declarations of@ExtendWith; nevernull- Returns:
- the new extension registry; never
null - Since:
- 5.0
-
registerExtensionsFromFields
static void registerExtensionsFromFields(ExtensionRegistrar registrar, Class<?> clazz, Object instance) Register extensions in the supplied registry from fields in the supplied class that are annotated with@RegisterExtension.The extensions will be sorted according to
@Ordersemantics prior to registration.- Parameters:
registrar- the registrar with which to register the extensions; nevernullclazz- the class or interface in which to find the fields; nevernullinstance- the instance of the supplied class; may benullwhen searching forstaticfields in the class
-
getOrder
- Since:
- 5.4
-