Annotation Interface As


@Retention(RUNTIME) @Target({METHOD,TYPE}) @Documented public @interface As
This annotation can be used to override the default representation for the items it was annotated with in the report. Works on step method, test method or class name.

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
  • Optional Element Summary

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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Dummy value to indicate that no value was set
  • Field Details

  • Element Details

    • value

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

      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