Class Scene

java.lang.Object
net.tangly.bdd.Scene

public class Scene
extends java.lang.Object
A scene is central to BDD or specification by example style of writing tests. It describes a use case in a story or specification and holds all the information required to execute a specific scenario. The Scene class enables test writers to define scenarios (behaviors) using steps like "given", "then", and "when" that are written as lambda expressions. The Scene class is the central unit of our custom extension that holds test method specific state information. The state information can be passed around between the various steps of a scenario. We use the “BeforeEachCallback” interface to prepare a Scene instance right before the invocation of a test method.
  • Constructor Summary

    Constructors 
    Constructor Description
    Scene​(java.lang.reflect.Method method)  
  • Method Summary

    Modifier and Type Method Description
    Scene and​(java.lang.String description, java.util.function.Consumer<Scene> and)  
    java.lang.String description()  
    <T> T get​(java.lang.String key)  
    Phase given()  
    Scene given​(java.lang.String description, java.util.function.Consumer<Scene> given)  
    java.lang.String methodName()  
    <T> void put​(java.lang.String key, T value)  
    Scene run()  
    Phase then()  
    Scene then​(java.lang.String description, java.util.function.Consumer<Scene> then)  
    Phase when()  
    Scene when​(java.lang.String description, java.util.function.Consumer<Scene> when)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Scene

      public Scene​(java.lang.reflect.Method method)
  • Method Details

    • put

      public <T> void put​(java.lang.String key, T value)
    • get

      public <T> T get​(java.lang.String key)
    • methodName

      public java.lang.String methodName()
    • description

      public java.lang.String description()
    • given

      public Scene given​(java.lang.String description, java.util.function.Consumer<Scene> given)
    • when

      public Scene when​(java.lang.String description, java.util.function.Consumer<Scene> when)
    • then

      public Scene then​(java.lang.String description, java.util.function.Consumer<Scene> then)
    • and

      public Scene and​(java.lang.String description, java.util.function.Consumer<Scene> and)
    • run

      public Scene run()
    • given

      public Phase given()
    • when

      public Phase when()
    • then

      public Phase then()