Created
December 30, 2018 10:06
-
-
Save lordofthejars/767a266c7494216dd2705d5b4baae979 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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