Class CallAnApi
java.lang.Object
net.serenitybdd.screenplay.rest.abilities.CallAnApi
- All Implemented Interfaces:
Ability
public class CallAnApi extends java.lang.Object implements Ability
A Screenplay ability that allows an actor to perform REST queries against a specified API.
For example:
```
Actor sam = Actor.named("Sam the supervisor").whoCan(CallAnApi.at("https://reqres.in"));
```
-
Method Summary
Modifier and Type Method Description static CallAnApias(Actor actor)Used to access the Actor's ability to CallAnApi from within the Interaction classes, such as GET or PUTstatic CallAnApiat(java.lang.String baseURL)Ability to Call and api at a specified baseUrlio.restassured.response.ResponsegetLastResponse()java.lang.Stringresolve(java.lang.String resource)java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Method Details
-
at
Ability to Call and api at a specified baseUrl -
as
Used to access the Actor's ability to CallAnApi from within the Interaction classes, such as GET or PUT -
resolve
public java.lang.String resolve(java.lang.String resource) -
getLastResponse
public io.restassured.response.Response getLastResponse() -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-