-
-
Save henesgokdag/c25bedd05eb7b6261223381e9a462460 to your computer and use it in GitHub Desktop.
mockGetPeople
This file contains 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 PeopleResponse mockGetPeople(OrderRequest orderRequest,Boolean isDarthVader) throws JsonProcessingException { | |
PeopleResponse peopleResponse = RandomDataProvider.random().nextObject(PeopleResponse.class); | |
if(isDarthVader) peopleResponse.setName("Darth Vader"); | |
String response = objectMapper.writeValueAsString(peopleResponse); | |
stubFor(get("/people/"+orderRequest.getPeopleId()) | |
.willReturn(aResponse() | |
.withStatus(200) | |
.withHeader("Content-Type", "application/json") | |
.withBody(String.valueOf(response)))); | |
return peopleResponse; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment