Search in sources :

Example 71 with Request

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

the class ServicesIT method verifySuccessfulPatchCallJsonArrayMultipartTrueData.

@Test(groups = { "integration", "service", "httppatch", "response" }, description = "An integration test to verify a successful patch call with parameters")
public void verifySuccessfulPatchCallJsonArrayMultipartTrueData() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    Map<String, Object> headers = new HashMap<>();
    headers.put("Content-Type", "multipart/form-data;");
    call.addHeaders(headers);
    call.patch("post/4", new Request().setJsonPayload(new JsonArray()).setMultipartData(new HashMap<>())).verifyEquals().message("");
    // verify no issues
    finish();
}
Also used : JsonArray(com.google.gson.JsonArray) Call(com.coveros.selenified.services.Call) HashMap(java.util.HashMap) Request(com.coveros.selenified.services.Request) JsonObject(com.google.gson.JsonObject) Test(org.testng.annotations.Test)

Example 72 with Request

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

the class ServicesIT method verifySuccessfulPostCallNoDataWithFile.

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

Example 73 with Request

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

the class ServicesIT method verifySuccessfulDeleteCallJsonObjectMultipartTrueData.

@Test(groups = { "integration", "service", "httpdelete", "response" }, description = "An integration test to verify a successful delete call with parameters")
public void verifySuccessfulDeleteCallJsonObjectMultipartTrueData() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    Map<String, Object> headers = new HashMap<>();
    headers.put("Content-Type", "multipart/form-data;");
    call.addHeaders(headers);
    call.delete("post/4", new Request().setJsonPayload(new JsonObject()).setMultipartData(new HashMap<>())).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) JsonObject(com.google.gson.JsonObject) JsonObject(com.google.gson.JsonObject) Test(org.testng.annotations.Test)

Example 74 with Request

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

the class ServicesIT method verifySuccessfulPatchCallJsonObjectDataWithFile.

@Test(groups = { "integration", "service", "httppatch", "response" }, description = "An integration test to verify a successful patch call with parameters")
public void verifySuccessfulPatchCallJsonObjectDataWithFile() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    call.patch("post/4", new Request().setJsonPayload(new JsonObject()), new File("Jenkinsfile")).verifyEquals().message("");
    // verify no issues
    finish();
}
Also used : Call(com.coveros.selenified.services.Call) Request(com.coveros.selenified.services.Request) JsonObject(com.google.gson.JsonObject) File(java.io.File) Test(org.testng.annotations.Test)

Example 75 with Request

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

the class ServicesIT method verifySuccessfulDeleteCallJsonObjectDataWithFile.

@Test(groups = { "integration", "service", "httpdelete", "response" }, description = "An integration test to verify a successful delete call with parameters")
public void verifySuccessfulDeleteCallJsonObjectDataWithFile() {
    // use this object to verify the app looks as expected
    Call call = this.calls.get();
    // perform some actions
    call.delete("post/4", new Request().setJsonPayload(new JsonObject()), new File("Jenkinsfile")).verifyEquals().objectData(simJson4);
    // verify no issues
    finish();
}
Also used : Call(com.coveros.selenified.services.Call) Request(com.coveros.selenified.services.Request) JsonObject(com.google.gson.JsonObject) File(java.io.File) 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