public static AnnotatedStepDescription from(final ExecutedStepDescription description) { return new AnnotatedStepDescription(description); }
public List<String> getAnnotatedRequirements() { List<String> requirements = new ArrayList<String>(); Method testMethod = getTestMethod(); if (testMethod != null) { addRequirementFrom(requirements, testMethod); addMultipleRequirementsFrom(requirements, testMethod); } return requirements; }
public Method getTestMethodIfPresent() { return findMethodCalled(description, getTestClass()); }
private String stepName() { String annotationTitle = getAnnotatedTitle(); if (!StringUtils.isEmpty(annotationTitle)) { return annotationTitle; } Optional<String> annotatedStepName = getAnnotatedStepName(); if (getAnnotatedStepName().isPresent() && (StringUtils.isNotEmpty(annotatedStepName.get()))) { return annotatedStepNameWithParameters(annotatedStepName.get()); } return humanize(description.getName()); }
private void recordStep(ExecutedStepDescription description) { String stepName = AnnotatedStepDescription.from(description).getName(); updateFluentStepStatus(description, stepName); if (justStartedAFluentSequenceFor(description) || notInAFluentSequence()) { TestStep step = new TestStep(stepName); startNewGroupIfNested(); setDefaultResultFromAnnotations(step, description); currentStepStack.push(step); recordStepToCurrentTestOutcome(step); } inFluentStepSequence = AnnotatedStepDescription.from(description).isFluent(); }
public Method getTestMethodIfPresent() { return findMethodCalled(withNoArguments(description.getName()), getTestClass()); }
private boolean isAnnotatedWithAValidStepAnnotation(final Method method) { Annotation[] annotations = method.getAnnotations(); for (Annotation annotation : annotations) { if (isAThucydidesStep(annotation) || (AnnotatedStepDescription.isACompatibleStep(annotation))) { return true; } } return false; }
private Method methodCalled(final ExecutedStepDescription methodName, final Class<?> testClass) { Method methodFound = findMethodCalled(methodName, testClass); if (methodFound == null) { throw new IllegalArgumentException("No test method called " + methodName + " was found in " + testClass); } return methodFound; }
private String stepName() { String annotationTitle = getAnnotatedTitle(); if (!StringUtils.isEmpty(annotationTitle)) { return annotationTitle; } Optional<String> annotatedStepName = getAnnotatedStepName(); if (getAnnotatedStepName().isPresent() && (StringUtils.isNotEmpty(annotatedStepName.get()))) { return annotatedStepNameWithParameters(annotatedStepName.get()); } return humanize(description.getName()); }
private void recordStep(ExecutedStepDescription description) { String stepName = AnnotatedStepDescription.from(description).getName(); updateFluentStepStatus(description, stepName); if (justStartedAFluentSequenceFor(description) || notInAFluentSequence()) { TestStep step = new TestStep(stepName); startNewGroupIfNested(); setDefaultResultFromAnnotations(step, description); currentStepStack.push(step); recordStepToCurrentTestOutcome(step); } inFluentStepSequence = AnnotatedStepDescription.from(description).isFluent(); }
public Method getTestMethodIfPresent() { return findMethodCalled(withNoArguments(description.getName()), getTestClass()); }
private void recordStep(ExecutedStepDescription description) { if (!latestTestOutcome().isPresent()) { return; } TestStep step = new TestStep(AnnotatedStepDescription.from(description).getName()); startNewGroupIfNested(); setDefaultResultFromAnnotations(step, description); currentStepStack.push(step); recordStepToCurrentTestOutcome(step); }
private boolean isAnnotatedWithAValidStepAnnotation(final Method method) { Annotation[] annotations = method.getAnnotations(); for (Annotation annotation : annotations) { if (isAThucydidesStep(annotation) || (AnnotatedStepDescription.isACompatibleStep(annotation))) { return true; } } return false; }
private Method methodCalled(final String methodName, final Class<?> testClass) { Method methodFound = findMethodCalled(methodName, testClass); if (methodFound == null) { throw new IllegalArgumentException("No test method called " + methodName + " was found in " + testClass); } return methodFound; }
private String stepName() { String annotationTitle = getAnnotatedTitle(); if (!StringUtils.isEmpty(annotationTitle)) { return annotationTitle; } Optional<String> annotatedStepName = getAnnotatedStepName(); if (getAnnotatedStepName().isPresent() && (StringUtils.isNotEmpty(annotatedStepName.get()))) { return annotatedStepNameWithParameters(annotatedStepName.get()); } return humanize(description.getName()); }
public List<String> getAnnotatedRequirements() { List<String> requirements = new ArrayList<>(); Method testMethod = getTestMethod(); if (testMethod != null) { addRequirementFrom(requirements, testMethod); addMultipleRequirementsFrom(requirements, testMethod); } return requirements; }
private boolean isAnnotatedWithAValidStepAnnotation(final Method method) { Annotation[] annotations = method.getAnnotations(); for (Annotation annotation : annotations) { if (isAThucydidesStep(annotation) || (AnnotatedStepDescription.isACompatibleStep(annotation))) { return true; } } return false; }