Skip to content

Instantly share code, notes, and snippets.

@dannyshain
Created April 12, 2021 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dannyshain/66f0f26f272221aac755248fc9bd8c36 to your computer and use it in GitHub Desktop.
Save dannyshain/66f0f26f272221aac755248fc9bd8c36 to your computer and use it in GitHub Desktop.
@Test
public void getCompanyData_checkCeo_shouldBeElonMusk() {
GraphQLQuery query = new GraphQLQuery();
query.setQuery("{ company { name ceo coo } }");
given().
contentType(ContentType.JSON).
body(query).
when().
post("https://api.spacex.land/graphql/").
then().
assertThat().
statusCode(200).
and().
body("data.company.ceo", equalTo("Elon Musk"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment