Created Apr 12, 2021
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_usingJSONObject() { | |
GraphQLQuery query = new GraphQLQuery(); | |
query.setQuery("query getLaunches($limit: Int!){ launches(limit: $limit) { mission_name } }"); | |
JSONObject variables = new JSONObject(); | |
variables.put("limit", 10); | |
query.setVariables(variables.toString()); | |
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