Skip to content

Instantly share code, notes, and snippets.

@thinkingserious
Created October 18, 2016 19:37
Show Gist options
  • Save thinkingserious/20cb445bed6a05771899209229a98f84 to your computer and use it in GitHub Desktop.
Save thinkingserious/20cb445bed6a05771899209229a98f84 to your computer and use it in GitHub Desktop.
Example of Using StopLight.io's Prism Mock Server in a Unit Test
@Test
public void test_alerts_get() throws IOException {
SendGrid sg = new SendGrid("SENDGRID_API_KEY", true);
sg.setHost("localhost:4010");
sg.addRequestHeader("X-Mock", "200");
Request request = new Request();
request.method = Method.GET;
request.endpoint = "alerts";
Response response = sg.api(request);
Assert.assertEquals(200, response.statusCode);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment