Package org.junit.jupiter.api
Annotation Interface Order
@Target({FIELD,METHOD})
@Retention(RUNTIME)
@Documented
@API(status=EXPERIMENTAL,
since="5.4")
public @interface Order
@Order
is an annotation that is used to configure the
order in which the annotated element (i.e., field or
method) should be evaluated or executed relative to other elements of the
same category.
When used with
@RegisterExtension
,
the category applies to extension fields. When used with the
MethodOrderer.OrderAnnotation
MethodOrderer
, the category applies to
test methods.
If @Order
is not explicitly declared on an element, the
DEFAULT
order value will be assigned to the element.
- Since:
- 5.4
- See Also:
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionint
The order value for the annotated element (i.e., field or method). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Default order value for elements not explicitly annotated with@Order
, equal to the value ofInteger.MAX_VALUE / 2
.
-
Field Details
-
DEFAULT
@API(status=EXPERIMENTAL, since="5.6") static final int DEFAULTDefault order value for elements not explicitly annotated with@Order
, equal to the value ofInteger.MAX_VALUE / 2
.- Since:
- 5.6
- See Also:
-
-
Element Details
-
value
int valueThe order value for the annotated element (i.e., field or method).Elements are ordered based on priority where a lower value has greater priority than a higher value. For example,
Integer.MAX_VALUE
has the lowest priority.- See Also:
-