Created
October 18, 2016 19:37
-
-
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
This file contains hidden or 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 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