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
    Modifier and Type
    Required Element
    Description
    Return the name of the story as human-readable information for living documentation.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Return the detailed description of the story as human-readable information for living documentation.
    Return the identifier of the story.
    Return the tags associated with the feature.
  • Element Details

    • value

      String value
      Return 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 description
      Return 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 id
      Return 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[] tags
      Return the tags associated with the feature. Tags provide domain-specific classification and additional information.
      Returns:
      tags defined in the feature
      Default:
      {}