Search in sources :

Example 51 with Operation

use of org.wso2.carbon.apimgt.common.analytics.publishers.dto.Operation in project product-iots by wso2.

the class AndroidOperation method testLocation.

@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android device location " + "operation.")
public void testLocation() throws Exception {
    HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.LOCATION_ENDPOINT, Constants.AndroidOperations.LOCATION_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 52 with Operation

use of org.wso2.carbon.apimgt.common.analytics.publishers.dto.Operation in project product-iots by wso2.

the class AndroidOperation method testGetApplications.

@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android get applications " + "operation.")
public void testGetApplications() throws Exception {
    HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.APPLICATION_LIST_ENDPOINT, Constants.AndroidOperations.PAYLOAD_COMMON);
    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 53 with Operation

use of org.wso2.carbon.apimgt.common.analytics.publishers.dto.Operation in project product-iots by wso2.

the class AndroidOperation method testWiFi.

@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android WiFi operation.")
public void testWiFi() throws Exception {
    HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.WIFI_ENDPOINT, Constants.AndroidOperations.WIFI_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 54 with Operation

use of org.wso2.carbon.apimgt.common.analytics.publishers.dto.Operation in project product-iots by wso2.

the class AndroidOperation method testEnterpriseWipe.

@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test Android enterprise-wipe " + "operation.")
public void testEnterpriseWipe() throws Exception {
    HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.ENTERPRISE_WIPE_ENDPOINT, Constants.AndroidOperations.ENTERPRISE_WIPE_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 55 with Operation

use of org.wso2.carbon.apimgt.common.analytics.publishers.dto.Operation in project product-iots by wso2.

the class AndroidOperation method testUpgradeFirmware.

@Test(groups = { Constants.AndroidOperations.OPERATIONS_GROUP }, description = "Test upgrade firmware operation")
public void testUpgradeFirmware() throws FileNotFoundException, MalformedURLException, AutomationFrameworkException {
    JsonObject upgradeFirmWarePayload = PayloadGenerator.getJsonPayload(Constants.AndroidOperations.OPERATION_PAYLOAD_FILE_NAME, Constants.AndroidOperations.UPGRADE_FIRMWARE_OPERATION);
    HttpResponse response = client.post(Constants.AndroidOperations.OPERATION_ENDPOINT + Constants.AndroidOperations.UPGRADE_FIRMWARE_ENDPOINT, upgradeFirmWarePayload.toString());
    Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}
Also used : JsonObject(com.google.gson.JsonObject) HttpResponse(org.wso2.carbon.automation.test.utils.http.client.HttpResponse) Test(org.testng.annotations.Test)

Aggregations

APIManagementException (org.wso2.carbon.apimgt.api.APIManagementException)79 HashMap (java.util.HashMap)55 ArrayList (java.util.ArrayList)43 APIProvider (org.wso2.carbon.apimgt.api.APIProvider)42 Test (org.testng.annotations.Test)34 URITemplate (org.wso2.carbon.apimgt.api.model.URITemplate)29 HttpResponse (org.wso2.carbon.automation.test.utils.http.client.HttpResponse)29 Map (java.util.Map)28 IOException (java.io.IOException)23 API (org.wso2.carbon.apimgt.api.model.API)22 List (java.util.List)20 JSONObject (org.json.simple.JSONObject)20 RegistryException (org.wso2.carbon.registry.core.exceptions.RegistryException)20 APIMgtResourceNotFoundException (org.wso2.carbon.apimgt.api.APIMgtResourceNotFoundException)19 LinkedHashMap (java.util.LinkedHashMap)18 FaultGatewaysException (org.wso2.carbon.apimgt.api.FaultGatewaysException)18 OperationPolicyData (org.wso2.carbon.apimgt.api.model.OperationPolicyData)18 APIInfo (org.wso2.carbon.apimgt.api.model.APIInfo)17 Connection (java.sql.Connection)16 PreparedStatement (java.sql.PreparedStatement)16