/** * Sets title using fluent-api * * @param title value to set * @return modified instance */ public StepStartedEvent withTitle(String title) { setTitle(title); return this; } }
@Before("anyMethod() && withStepAnnotation()") public void stepStart(JoinPoint joinPoint) { String stepTitle = createTitle(joinPoint); MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature(); StepStartedEvent startedEvent = new StepStartedEvent( getName(methodSignature.getName(), joinPoint.getArgs()) ); if (!stepTitle.isEmpty()) { startedEvent.setTitle(stepTitle); } ALLURE.fire(startedEvent); }