Search in sources :

Example 1 with Response

use of com.coveros.selenified.services.Response in project selenified by Coveros.

the class OutputFileTest method formatResponseEmptyObjectTest.

@Test
public void formatResponseEmptyObjectTest() {
    JsonObject json = new JsonObject();
    Response response = new Response(0, json, null);
    Assert.assertEquals(outputFile.formatResponse(response), "<div><i>{}</i></div>");
}
Also used : Response(com.coveros.selenified.services.Response) JsonObject(com.google.gson.JsonObject) Test(org.testng.annotations.Test)

Example 2 with Response

use of com.coveros.selenified.services.Response in project selenified by Coveros.

the class OutputFileTest method formatResponseNullNullTest.

@Test
public void formatResponseNullNullTest() {
    JsonObject json = new JsonObject();
    Response response = new Response(0, json, null);
    response.setObjectData(null);
    Assert.assertEquals(outputFile.formatResponse(response), "");
}
Also used : Response(com.coveros.selenified.services.Response) JsonObject(com.google.gson.JsonObject) Test(org.testng.annotations.Test)

Example 3 with Response

use of com.coveros.selenified.services.Response in project selenified by Coveros.

the class OutputFileTest method formatResponseEmptyArrayTest.

@Test
public void formatResponseEmptyArrayTest() {
    JsonArray json = new JsonArray();
    Response response = new Response(0, json, null);
    Assert.assertEquals(outputFile.formatResponse(response), "<div><i>[]</i></div>");
}
Also used : JsonArray(com.google.gson.JsonArray) Response(com.coveros.selenified.services.Response) Test(org.testng.annotations.Test)

Example 4 with Response

use of com.coveros.selenified.services.Response in project selenified by Coveros.

the class ResponseTest method checkNewResponseArrayObjectTest.

@Test
public void checkNewResponseArrayObjectTest() {
    JsonArray json = new JsonArray();
    Response response = new Response(5, json, "");
    Assert.assertNull(response.getObjectData());
}
Also used : JsonArray(com.google.gson.JsonArray) Response(com.coveros.selenified.services.Response) Test(org.testng.annotations.Test)

Example 5 with Response

use of com.coveros.selenified.services.Response in project selenified by Coveros.

the class ResponseTest method checkNewResponseCodeMessageTest.

@Test
public void checkNewResponseCodeMessageTest() {
    Response response = new Response(5);
    Assert.assertNull(response.getMessage());
}
Also used : Response(com.coveros.selenified.services.Response) Test(org.testng.annotations.Test)

Aggregations

Response (com.coveros.selenified.services.Response)44 Test (org.testng.annotations.Test)44 JsonObject (com.google.gson.JsonObject)24 JsonArray (com.google.gson.JsonArray)17 HashMap (java.util.HashMap)3 OutputFile (com.coveros.selenified.OutputFile)1