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 CallAnApi as​(Actor actor)
    Used to access the Actor's ability to CallAnApi from within the Interaction classes, such as GET or PUT
    static CallAnApi at​(java.lang.String baseURL)
    Ability to Call and api at a specified baseUrl
    io.restassured.response.Response getLastResponse()  
    java.lang.String resolve​(java.lang.String resource)  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • at

      public static CallAnApi at​(java.lang.String baseURL)
      Ability to Call and api at a specified baseUrl
    • as

      public static CallAnApi as​(Actor actor)
      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:
      toString in class java.lang.Object