net.serenitybdd.screenplay.rest.interactions.Head Maven / Gradle / Ivy
package net.serenitybdd.screenplay.rest.interactions;
import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.annotations.Step;
import static net.serenitybdd.screenplay.Tasks.instrumented;
import static net.serenitybdd.screenplay.rest.abilities.CallAnApi.as;
/**
* Path something to a REST resource.
* This is a simple interaction class suitable for simple queries.
*/
public class Head extends RestInteraction {
private final String resource;
public Head(String resource) {
this.resource = resource;
}
@Step("{0} executes a HEAD on the resource #resource")
@Override
public void performAs(T actor) {
rest().head(as(actor).resolve(resource));
}
public static Head to(String resource) {
return instrumented(Head.class, resource);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy