Created
April 12, 2021 20:38
-
-
Save dannyshain/bb79ba669027269998d8f22275326119 to your computer and use it in GitHub Desktop.
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
@Test | |
public void getLaunches_checkMissionName_shouldBeThaicom6_usingPOJO() { | |
GraphQLQuery query = new GraphQLQuery(); | |
query.setQuery("query getLaunches($limit: Int!){ launches(limit: $limit) { mission_name } }"); | |
QueryLimit queryLimit = new QueryLimit(); | |
queryLimit.setLimit(10); | |
query.setVariables(queryLimit); | |
given(). | |
contentType(ContentType.JSON). | |
body(query). | |
when(). | |
post("https://api.spacex.land/graphql/"). | |
then(). | |
assertThat(). | |
statusCode(200). | |
and(). | |
body("data.launches[0].mission_name", equalTo("Thaicom 6")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment