Search in sources :

Example 31 with HttpResponse

use of org.wso2.carbon.automation.test.utils.http.client.HttpResponse in project product-iots by wso2.

the class AndroidOperation method testUnLock.

@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android device un-lock " + "operation.")
public void testUnLock() throws MalformedURLException, AutomationFrameworkException {
    HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.UNLOCK_ENDPOINT, Constants.AndroidOperations.UNLOCK_OPERATION_PAYLOAD);
    Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}
Also used : HttpResponse(org.wso2.carbon.automation.test.utils.http.client.HttpResponse) Test(org.testng.annotations.Test)

Example 32 with HttpResponse

use of org.wso2.carbon.automation.test.utils.http.client.HttpResponse in project product-iots by wso2.

the class AndroidOperation method testCamera.

@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android device camera " + "operation.")
public void testCamera() throws Exception {
    HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.CAMERA_OPERATION, Constants.AndroidOperations.CAMERA_OPERATION_PAYLOAD);
    Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}
Also used : HttpResponse(org.wso2.carbon.automation.test.utils.http.client.HttpResponse) Test(org.testng.annotations.Test)

Example 33 with HttpResponse

use of org.wso2.carbon.automation.test.utils.http.client.HttpResponse in project product-iots by wso2.

the class AndroidOperation method testMute.

@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android mute operation.")
public void testMute() throws Exception {
    HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.MUTE_ENDPOINT, Constants.AndroidOperations.MUTE_PAYLOAD);
    Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}
Also used : HttpResponse(org.wso2.carbon.automation.test.utils.http.client.HttpResponse) Test(org.testng.annotations.Test)

Example 34 with HttpResponse

use of org.wso2.carbon.automation.test.utils.http.client.HttpResponse in project product-iots by wso2.

the class FeatureManagement method testViewFeatures.

@Test(description = "Test view features.")
public void testViewFeatures() throws Exception {
    HttpResponse response = client.get(Constants.FeatureManagement.VIEW_FEATURES_ENDPOINT);
    Assert.assertEquals(HttpStatus.SC_OK, response.getResponseCode());
}
Also used : HttpResponse(org.wso2.carbon.automation.test.utils.http.client.HttpResponse) Test(org.testng.annotations.Test)

Example 35 with HttpResponse

use of org.wso2.carbon.automation.test.utils.http.client.HttpResponse in project product-iots by wso2.

the class VirtualFireAlarmTestCase method initTest.

@BeforeClass(alwaysRun = true)
public void initTest() throws Exception {
    super.init(userMode);
    restClient = new RestClient(backendHTTPSURL, Constants.APPLICATION_JSON, accessTokenString);
    if (userMode == TestUserMode.TENANT_ADMIN) {
        HttpResponse response = restClient.post(Constants.VirtualFireAlarmConstants.ANALYTICS_ARTIFACTS_DEPLOYMENT_ENDPOINT, "");
        Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
    }
}
Also used : RestClient(org.wso2.iot.integration.common.RestClient) HttpResponse(org.wso2.carbon.automation.test.utils.http.client.HttpResponse) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

HttpResponse (org.wso2.carbon.automation.test.utils.http.client.HttpResponse)75 Test (org.testng.annotations.Test)72 JsonObject (com.google.gson.JsonObject)15 HTTPResponse (org.wso2.mdm.qsg.dto.HTTPResponse)15 JsonParser (com.google.gson.JsonParser)14 JSONObject (org.json.simple.JSONObject)11 HashMap (java.util.HashMap)9 JsonArray (com.google.gson.JsonArray)8 IOException (java.io.IOException)8 HttpURLConnection (java.net.HttpURLConnection)8 APIManagementException (org.wso2.carbon.apimgt.core.exception.APIManagementException)7 KeyManagementException (java.security.KeyManagementException)6 KeyStoreException (java.security.KeyStoreException)6 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)6 HttpResponse (org.apache.http.HttpResponse)6 ClientProtocolException (org.apache.http.client.ClientProtocolException)6 CloseableHttpClient (org.apache.http.impl.client.CloseableHttpClient)6 HttpPost (org.apache.http.client.methods.HttpPost)5 JSONArray (org.json.simple.JSONArray)5 JsonElement (com.google.gson.JsonElement)4