Class RestQuestion<T>
java.lang.Object
net.serenitybdd.screenplay.rest.questions.RestQuestion<T>
- All Implemented Interfaces:
Question<T>
public class RestQuestion<T> extends java.lang.Object implements Question<T>
A REST query that sends a GET request to an endpoint and returns a result of a given type.
Sample usage:
public static Question<Float> cashBalanceFor(Client client) {
return new RestQuestionBuilder<Float>().about("Cash account balance")
.to("/client/{clientId}/portfolio")
.withParameters(request -> request.pathParam("clientId", client.getId()))
.returning(response -> response.path("cash"));
}
-
Constructor Summary
Constructors Constructor Description RestQuestion(java.lang.String name, java.lang.String endpoint, java.util.List<RestQueryFunction> queries, java.util.function.Function<io.restassured.response.Response,T> result) -
Method Summary
Modifier and Type Method Description TansweredBy(Actor actor)java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.serenitybdd.screenplay.Question
getSubject
-
Constructor Details
-
RestQuestion
public RestQuestion(java.lang.String name, java.lang.String endpoint, java.util.List<RestQueryFunction> queries, java.util.function.Function<io.restassured.response.Response,T> result)
-
-
Method Details
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
answeredBy
- Specified by:
answeredByin interfaceQuestion<T>
-