Top Description Fields Methods
org.junit.jupiter.api

public @Interface Order

extends Annotation
Annotations
@Target:FIELD, METHOD, TYPE
@Retention:RUNTIME
@Documented
@API
status:STABLE
since:5.9
Static Imports
org.apiguardian.api.API.Status.STABLE

@Order is an annotation that is used to configure the order in which the annotated element (i.e., field, method, or class) should be evaluated or executed relative to other elements of the same category.

When used with @RegisterExtension or @ExtendWith, the category applies to extension fields. When used with MethodOrderer.OrderAnnotation, the category applies to test methods. When used with ClassOrderer.OrderAnnotation, the category applies to test classes.

If @Order is not explicitly declared on an element, the DEFAULT order value will be assigned to the element.

Since
5.4
See Also
MethodOrderer.OrderAnnotation, ClassOrderer.OrderAnnotation, @RegisterExtension, @ExtendWith

Field Summary

Modifier and TypeField and Description
public static final int
DEFAULT

Default order value for elements not explicitly annotated with @Order, equal to the value of Integer.MAX_VALUE / 2.

Method Summary

Modifier and TypeMethod and Description
public int
value()

The order value for the annotated element (i.e., field, method, or class).

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Field Detail

DEFAULTback to summary
public static final int DEFAULT

Default order value for elements not explicitly annotated with @Order, equal to the value of Integer.MAX_VALUE / 2.

Since
5.6
See Also
Order#value

Method Detail

valueback to summary
public int value()

The order value for the annotated element (i.e., field, method, or class).

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
DEFAULT