Search in sources :

Example 11 with RestClient

use of org.wso2.iot.integration.common.RestClient in project product-iots by wso2.

the class MobileQSGTestCase method testMobileApp.

@Test(description = "This test case tests whether app-catalogue is created from qsg script", dependsOnMethods = { "executeQSGScript" })
public void testMobileApp() throws Exception {
    RestClient appManagerRestClient = new RestClient(automationContext.getContextUrls().getWebAppURLHttps(), Constants.APPLICATION_JSON, accessTokenString);
    HttpResponse response = appManagerRestClient.get(Constants.QSGManagement.GET_MOBILE_APPS_ENDPONT);
    Assert.assertEquals(response.getResponseCode(), HttpStatus.SC_OK);
    Assert.assertTrue(response.getData().contains("WSO2Con-Android"), "Con-App-Android addition through script is not successful");
}
Also used : RestClient(org.wso2.iot.integration.common.RestClient) HttpResponse(org.wso2.carbon.automation.test.utils.http.client.HttpResponse) Test(org.testng.annotations.Test)

Example 12 with RestClient

use of org.wso2.iot.integration.common.RestClient in project product-iots by wso2.

the class UserManagement method initTest.

@BeforeClass(alwaysRun = true, groups = { Constants.UserManagement.USER_MANAGEMENT_GROUP })
public void initTest() throws Exception {
    super.init(userMode);
    this.client = new RestClient(backendHTTPSURL, Constants.APPLICATION_JSON, accessTokenString);
}
Also used : RestClient(org.wso2.iot.integration.common.RestClient) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

RestClient (org.wso2.iot.integration.common.RestClient)11 BeforeClass (org.testng.annotations.BeforeClass)9 HttpResponse (org.wso2.carbon.automation.test.utils.http.client.HttpResponse)5 Test (org.testng.annotations.Test)2 JsonArray (com.google.gson.JsonArray)1 JsonObject (com.google.gson.JsonObject)1 JsonParser (com.google.gson.JsonParser)1 JSONObject (org.json.JSONObject)1 User (org.wso2.carbon.automation.engine.context.beans.User)1