Search in sources :

Example 1 with Article

use of com.baeldung.unirest.Article in project tutorials by eugenp.

the class HttpClientTest method givenArticleWhenCreatedThenCorrect.

@Test
public void givenArticleWhenCreatedThenCorrect() throws UnirestException {
    Article article = new Article("ID1213", "Guide to Rest", "baeldung");
    HttpResponse<JsonNode> jsonResponse = Unirest.post("http://www.mocky.io/v2/5a9ce7663100006800ab515d").body(article).asJson();
    assertEquals(201, jsonResponse.getStatus());
}
Also used : Article(com.baeldung.unirest.Article) JsonNode(com.mashape.unirest.http.JsonNode) Test(org.junit.Test)

Aggregations

Article (com.baeldung.unirest.Article)1 JsonNode (com.mashape.unirest.http.JsonNode)1 Test (org.junit.Test)1