Annotation Interface Story
@Target(TYPE)
@Retention(RUNTIME)
@Testable
@ExtendWith(StoryExtension.class)
public @interface Story
Represents a story in BDD or specification by example style of writing tests. Notice that the annotation is meta-annotated with JUnit 5 built-in "@Testable" annotation. This
annotation gives IDEs and other tools a way to identify classes and methods that are testable––meaning the annotated class or method can be executed by a test engine like JUnit
5 Jupiter test engine.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
value
String valueReturn the name of the story as human-readable information for living documentation.- Returns:
- short summary of the story in a plain human language.
-
description
String descriptionReturn the detailed description of the story as human-readable information for living documentation. One could describe a story in this format: As a {user-defined string}, to {user-defined string}, I want to {user-defined string}.- Returns:
- the story in a plain human language.
- Default:
""
-
id
String idReturn the identifier of the story. The identifier can be used for cross-reference and traceability of the requirements.- Returns:
- identifier of the story unique in the context of the application domain
- Default:
""
-
tags
String[] tagsReturn the tags associated with the feature. Tags provide domain-specific classification and additional information.- Returns:
- tags defined in the feature
- Default:
{}
-