Package io.qameta.allure.util
Class AnnotationUtils
java.lang.Object
io.qameta.allure.util.AnnotationUtils
Collection of utils used by Allure integration to extract meta information from
test cases via reflection.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Set<io.qameta.allure.model.Label> getLabels(Annotation... annotations) Shortcut forgetLabels(Collection).static Set<io.qameta.allure.model.Label> getLabels(AnnotatedElement annotatedElement) Returns labels created from Allure meta annotations specified on annotated element.static Set<io.qameta.allure.model.Label> getLabels(Collection<Annotation> annotations) Returns labels from given annotations.static Set<io.qameta.allure.model.Link> getLinks(Annotation... annotations) Shortcut forgetLinks(Collection).static Set<io.qameta.allure.model.Link> getLinks(AnnotatedElement annotatedElement) Returns links created from Allure meta annotations specified on annotated element.static Set<io.qameta.allure.model.Link> getLinks(Collection<Annotation> annotations) Returns links from given annotations.static Optional<SeverityLevel> getSeverity(AnnotatedElement annotatedElement) Returns the severity specified by theSeverityannotation.static Optional<SeverityLevel> getSeverity(Collection<Annotation> annotations) Returns the severity specified by theSeverityannotation within given annotations.static booleanisFlaky(AnnotatedElement annotatedElement) Returns true ifFlakyannotation is present.static booleanisFlaky(Collection<Annotation> annotations) Returns true ifFlakyannotation is present within given annotations, either directly or as a meta annotation.static booleanisMuted(AnnotatedElement annotatedElement) Returns true ifMutedannotation is present.static booleanisMuted(Collection<Annotation> annotations) Returns true ifMutedannotation is present within given annotations, either directly or as a meta annotation.
-
Method Details
-
isFlaky
Returns true ifFlakyannotation is present. The annotation is also discovered when used as a meta annotation on other (custom) annotations.- Parameters:
annotatedElement- the element to search annotations on.- Returns:
- true if
Flakyannotation is present, false otherwise.
-
isFlaky
Returns true ifFlakyannotation is present within given annotations, either directly or as a meta annotation.- Parameters:
annotations- annotations to analyse.- Returns:
- true if
Flakyannotation is present, false otherwise.
-
isMuted
Returns true ifMutedannotation is present. The annotation is also discovered when used as a meta annotation on other (custom) annotations.- Parameters:
annotatedElement- the element to search annotations on.- Returns:
- true if
Mutedannotation is present, false otherwise.
-
isMuted
Returns true ifMutedannotation is present within given annotations, either directly or as a meta annotation.- Parameters:
annotations- annotations to analyse.- Returns:
- true if
Mutedannotation is present, false otherwise.
-
getSeverity
Returns the severity specified by theSeverityannotation. The annotation is also discovered when used as a meta annotation on other (custom) annotations.- Parameters:
annotatedElement- the element to search annotations on.- Returns:
- the discovered severity, if any.
-
getSeverity
Returns the severity specified by theSeverityannotation within given annotations. A directly declaredSeveritytakes precedence; otherwise the annotation is also discovered when used as a meta annotation on other (custom) annotations.- Parameters:
annotations- annotations to analyse.- Returns:
- the discovered severity, if any.
-
getLinks
Returns links created from Allure meta annotations specified on annotated element.- Parameters:
annotatedElement- the element to search annotations on.- Returns:
- discovered links.
-
getLinks
Shortcut forgetLinks(Collection).- Parameters:
annotations- annotations to analyse.- Returns:
- discovered links.
-
getLinks
Returns links from given annotations.- Parameters:
annotations- annotations to analyse.- Returns:
- discovered links.
-
getLabels
Returns labels created from Allure meta annotations specified on annotated element. Shortcut forgetLinks(Annotation...)- Parameters:
annotatedElement- the element to search annotations on.- Returns:
- discovered labels.
-
getLabels
Shortcut forgetLabels(Collection).- Parameters:
annotations- annotations to analyse.- Returns:
- discovered labels.
-
getLabels
Returns labels from given annotations.- Parameters:
annotations- annotations to analyse.- Returns:
- discovered labels.
-