use of com.coveros.selenified.services.Response in project selenified by Coveros.
the class ResponseTest method checkNewResponseObjectArrayTest.
@Test
public void checkNewResponseObjectArrayTest() {
JsonObject json = new JsonObject();
Response response = new Response(5, json, "");
Assert.assertNull(response.getArrayData());
}
use of com.coveros.selenified.services.Response in project selenified by Coveros.
the class ResponseTest method checkNewResponseFileCodeTest.
@Test
public void checkNewResponseFileCodeTest() {
Response response = new Response(outputFile);
Assert.assertEquals(response.getCode(), 0);
}
use of com.coveros.selenified.services.Response in project selenified by Coveros.
the class ResponseTest method checkNewResponseArrayCodeTest.
@Test
public void checkNewResponseArrayCodeTest() {
JsonArray json = new JsonArray();
Response response = new Response(5, json, "");
Assert.assertEquals(response.getCode(), 5);
}
use of com.coveros.selenified.services.Response in project selenified by Coveros.
the class ResponseTest method confirmEqualsObjectPassTest.
@Test
public void confirmEqualsObjectPassTest() throws IOException {
JsonObject json = new JsonObject();
json.addProperty("name", "john");
Response response = new Response(5, json, "");
response.setOutputFile(outputFile);
response.assertEquals(json);
String content = Files.toString(file, Charsets.UTF_8);
Assert.assertTrue(content.matches("[.\\s\\S]+ <tr>\n <td align='center'>1.</td>\n <td> </td>\n <td>Expected to find a response of:<div><i>\\{<br/>\\ \\ \"name\":\\ \"john\"<br/>\\}</i></div></td>\n <td>Found a response of:<div><i>\\{<br/>\\ \\ \"name\":\\ \"john\"<br/>\\}</i></div></td>\n <td>[0-9]+ms / [0-9]+ms</td>\n <td class='pass'>Pass</td>\n </tr>\n"));
}
Aggregations