Annotation Type As


  • @Retention(RUNTIME)
    @Target({METHOD,TYPE})
    @Documented
    public @interface As
    This annotation can be used to override the default representation for a step method, test method or class name in the report.

    Note that the '$' character keeps its special meaning and will be replaced with step arguments

     @As("some (complicated) step")
     public SELF some_complicated_step() {
        ...
     }
     
     @As("Some 'special' scenario description")
     @Test
     public void some_special_scenario_description() {
        ...
     }
     
    Since:
    0.7.4. Since 0.9.0 this annotation can be applied to test classes as well
    • Field Summary

      Fields 
      Modifier and Type Fields Description
      static java.lang.String NO_VALUE
      Dummy value to indicate that no value was set
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.Class<? extends AsProvider> provider
      An optional provider to generate the representation of the stage method, scenario or scenario class.
      java.lang.String value
      The alternate representation of the step or scenario summary.
    • Field Detail

      • NO_VALUE

        static final java.lang.String NO_VALUE
        Dummy value to indicate that no value was set
    • Element Detail

      • value

        java.lang.String value
        The alternate representation of the step or scenario summary.
        Default:
        " - no value - "
      • provider

        java.lang.Class<? extends AsProvider> provider
        An optional provider to generate the representation of the stage method, scenario or scenario class.

        The class that implements AsProvider interface must be a public non-abstract class that is not a non-static inner class and must have a public default constructor.

        If this attribute is set, the value() attribute is ignored.

        Since:
        0.12.0
        Default:
        com.tngtech.jgiven.impl.params.DefaultAsProvider.class