Skip to content

Instantly share code, notes, and snippets.

@lordofthejars
Created December 30, 2018 10:06
Show Gist options
  • Save lordofthejars/767a266c7494216dd2705d5b4baae979 to your computer and use it in GitHub Desktop.
Save lordofthejars/767a266c7494216dd2705d5b4baae979 to your computer and use it in GitHub Desktop.
public class FindAUser implements Task{
private final int id;
public FindAUser(int id) {
this.id = id;
}
public static FindAUser withId(int id) {
return instrumented(FindAUser.class, id);
}
@Override
@Step("{0} fetches the user with id #id")
public <T extends Actor> void performAs(T actor) {
actor.attemptsTo(
Get.resource("/users/{id}")
.with(request -> request.pathParam("id", id))
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment