Class CoreStepDefinition

java.lang.Object
io.cucumber.core.runner.CoreStepDefinition
All Implemented Interfaces:
Located, StepDefinition

final class CoreStepDefinition extends Object implements StepDefinition
  • Field Details

  • Constructor Details

  • Method Details

    • getTypes

      private static Type[] getTypes(List<ParameterInfo> parameterInfos)
    • getExpression

      StepExpression getExpression()
    • getStepDefinition

      StepDefinition getStepDefinition()
    • matchedArguments

      @Nullable List<Argument> matchedArguments(Step step)
    • getId

      UUID getId()
    • execute

      Description copied from interface: StepDefinition
      Invokes the step definition. The method should raise a Throwable if the invocation fails, which will cause the step to fail.
      Specified by:
      execute in interface StepDefinition
      Parameters:
      args - The arguments for the step
      Throws:
      CucumberBackendException - of a failure to invoke the step
      CucumberInvocationTargetException - in case of a failure in the step.
    • parameterInfos

      public List<ParameterInfo> parameterInfos()
      Description copied from interface: StepDefinition
      Return parameter information.
      Specified by:
      parameterInfos in interface StepDefinition
      Returns:
      parameter information, may not return null
    • getPattern

      public String getPattern()
      Description copied from interface: StepDefinition
      Return the pattern associated with this instance. Used for error reporting only.
      Specified by:
      getPattern in interface StepDefinition
      Returns:
      the pattern associated with this instance.
    • isDefinedAt

      public boolean isDefinedAt(StackTraceElement stackTraceElement)
      Description copied from interface: Located
      Return true if this matches the location. This is used to filter stack traces.
      Specified by:
      isDefinedAt in interface Located
      Parameters:
      stackTraceElement - The location of the step.
      Returns:
      Return true if this matches the location.
    • getLocation

      public String getLocation()
      Description copied from interface: Located
      Location of step definition. Can either be a a method or stack trace style location.

      Examples:

      • com.example.StepDefinitions.given_an_example(io.cucumber.datatable.DataTable)
      • com.example.StepDefinitions.<init>(StepDefinitions.java:9)
      Specified by:
      getLocation in interface Located
      Returns:
      The source line of the step definition.
    • getDefinitionLocation

      Optional<SourceReference> getDefinitionLocation()