
net.serenitybdd.screenplay.questions.SumQuestion Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of serenity-screenplay Show documentation
Show all versions of serenity-screenplay Show documentation
Support for the User Journey pattern in Serenity
package net.serenitybdd.screenplay.questions;
import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Question;
import net.serenitybdd.screenplay.annotations.Subject;
import java.util.Collection;
@Subject("the sum of #listQuestion")
public class SumQuestion implements Question {
private final Question extends Collection> listQuestion;
public SumQuestion(Question extends Collection> listQuestion) {
this.listQuestion = listQuestion;
}
@Override
public Integer answeredBy(Actor actor) {
Integer total = 0;
for (Integer number : listQuestion.answeredBy(actor)) {
total = total + number;
}
return total;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy