Search in sources :

Example 96 with Request

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

the class ServicesIT method verifySuccessfulPostCallMultipartDataWithFile.

@Test(groups = { "integration", "service", "httppost", "response" }, description = "An integration test to verify a successful post call with parameters")
public void verifySuccessfulPostCallMultipartDataWithFile() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    call.post("post/4", new Request().setMultipartData(new HashMap<>()), new File("Jenkinsfile")).verifyEquals().objectData(simJson4);
    // verify no issues
    finish();
}
Also used : Call(com.coveros.selenified.services.Call) HashMap(java.util.HashMap) Request(com.coveros.selenified.services.Request) File(java.io.File) Test(org.testng.annotations.Test)

Example 97 with Request

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

the class OutputFileTest method outputRequestPropertiesBothTest.

@Test
public void outputRequestPropertiesBothTest() {
    Map<String, String> map = new HashMap<>();
    map.put("hello", "world");
    Request request = new Request(map);
    JsonObject json = new JsonObject();
    json.addProperty("hello", "world");
    request.setData(json);
    Assert.assertEquals(outputFile.outputRequestProperties(request), "<br/>&nbsp;with&nbsp;parameters:&nbsp;<div><i>{<br/>&nbsp;&nbsp;\"hello\":&nbsp;\"world\"<br/>}<div>hello&nbsp;:&nbsp;world</div></i></div>");
}
Also used : HashMap(java.util.HashMap) Request(com.coveros.selenified.services.Request) JsonObject(com.google.gson.JsonObject) Test(org.testng.annotations.Test)

Example 98 with Request

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

the class OutputFileTest method outputRequestPropertiesDataTest.

@Test
public void outputRequestPropertiesDataTest() {
    JsonObject json = new JsonObject();
    json.addProperty("hello", "world");
    Request request = new Request(json);
    Assert.assertEquals(outputFile.outputRequestProperties(request), "<br/>&nbsp;with&nbsp;parameters:&nbsp;<div><i>{<br/>&nbsp;&nbsp;\"hello\":&nbsp;\"world\"<br/>}</i></div>");
}
Also used : Request(com.coveros.selenified.services.Request) JsonObject(com.google.gson.JsonObject) Test(org.testng.annotations.Test)

Example 99 with Request

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

the class OutputFileTest method outputRequestPropertiesEmptyParamsTest.

@Test
public void outputRequestPropertiesEmptyParamsTest() {
    Request request = new Request(new HashMap<>());
    Assert.assertEquals(outputFile.outputRequestProperties(request), "<br/>&nbsp;with&nbsp;parameters:&nbsp;<div><i></i></div>");
}
Also used : Request(com.coveros.selenified.services.Request) Test(org.testng.annotations.Test)

Example 100 with Request

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

the class RequestTest method checkJsonRequestTest.

@Test
public void checkJsonRequestTest() {
    JsonObject json = new JsonObject();
    Request request = new Request(json);
    Assert.assertEquals(request.getData(), json);
}
Also used : Request(com.coveros.selenified.services.Request) JsonObject(com.google.gson.JsonObject) Test(org.testng.annotations.Test)

Aggregations

Request (com.coveros.selenified.services.Request)198 Test (org.testng.annotations.Test)197 Call (com.coveros.selenified.services.Call)142 JsonObject (com.google.gson.JsonObject)115 HashMap (java.util.HashMap)102 File (java.io.File)32 JsonArray (com.google.gson.JsonArray)30 HTTP (com.coveros.selenified.services.HTTP)5 JsonParser (com.google.gson.JsonParser)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1