Class StepModelPatchAspect


  • public class StepModelPatchAspect
    extends Object
    Patches StepModel in order to allow correct reporting of step execution duration.

    https://github.com/TNG/JGiven/issues/755

    IMPORTANT: requires having com.tngtech.jgiven:jgiven-core as a weave dependency.

    • Constructor Detail

      • StepModelPatchAspect

        public StepModelPatchAspect()
    • Method Detail

      • aroundSetDurationInNanos

        public void aroundSetDurationInNanos​(org.aspectj.lang.ProceedingJoinPoint thisJoinPoint,
                                             com.tngtech.jgiven.report.model.StepModel stepModel)
                                      throws Throwable
        Monitors attempts to set step method's duration. If the duration is already set, then overrides to do nothing.
        Parameters:
        thisJoinPoint - this join-point
        stepModel - instance of StepModel
        Throws:
        Throwable - any...
        See Also:
        setDurationInNanos(StepModel)
      • setDurationInNanos

        public void setDurationInNanos​(com.tngtech.jgiven.report.model.StepModel stepModel)
        Matches the execution of StepModel.setDurationInNanos(long)
        Parameters:
        stepModel - instance of StepModel