use of org.wso2.iot.integration.common.RestClient in project product-iots by wso2.
the class FeatureManagement method initTest.
@BeforeClass(alwaysRun = true, groups = { Constants.FeatureManagement.FEATURE_MANAGEMENT_GROUP })
public void initTest() throws Exception {
super.init(TestUserMode.SUPER_TENANT_ADMIN);
String accessTokenString = "Bearer " + OAuthUtil.getOAuthToken(backendHTTPSURL, backendHTTPSURL);
this.client = new RestClient(backendHTTPSURL, Constants.APPLICATION_JSON, accessTokenString);
}
use of org.wso2.iot.integration.common.RestClient in project product-iots by wso2.
the class DeviceTypeManagementJMeterTestCase method initTest.
@BeforeClass(alwaysRun = true)
public void initTest() throws Exception {
super.init(TestUserMode.SUPER_TENANT_ADMIN);
restClient = new RestClient(backendHTTPSURL, Constants.APPLICATION_JSON, accessTokenString);
}
use of org.wso2.iot.integration.common.RestClient in project product-iots by wso2.
the class AndroidSenseEnrollment method initTest.
@BeforeClass(alwaysRun = true, groups = { Constants.UserManagement.USER_MANAGEMENT_GROUP })
public void initTest() throws Exception {
super.init(userMode);
User currentUser = getAutomationContext().getContextTenant().getContextUser();
byte[] bytesEncoded = Base64.encodeBase64((currentUser.getUserName() + ":" + currentUser.getPassword()).getBytes());
String encoded = new String(bytesEncoded);
String auth_string = "Basic " + encoded;
String anaytics_https_url = automationContext.getContextUrls().getWebAppURLHttps().replace("9443", String.valueOf(Constants.HTTPS_ANALYTICS_PORT)).replace("/t/" + automationContext.getContextTenant().getDomain(), "") + "/";
this.client = new RestClient(backendHTTPSURL, Constants.APPLICATION_JSON, accessTokenString);
this.analyticsClient = new RestClient(anaytics_https_url, Constants.APPLICATION_JSON, auth_string);
if (this.userMode == TestUserMode.TENANT_ADMIN) {
HttpResponse response = client.post(Constants.AndroidSenseEnrollment.ANALYTICS_ARTIFACTS_DEPLOYMENT_ENDPOINT, "");
Assert.assertEquals(HttpStatus.SC_CREATED, response.getResponseCode());
}
}
use of org.wso2.iot.integration.common.RestClient in project product-iots by wso2.
the class AndroidEnrollment 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);
}
use of org.wso2.iot.integration.common.RestClient in project product-iots by wso2.
the class WindowsEnrollment method initTest.
@BeforeClass(alwaysRun = true, groups = { Constants.WindowsEnrollment.WINDOWS_ENROLLMENT_GROUP })
public void initTest() throws Exception {
super.init(TestUserMode.SUPER_TENANT_ADMIN);
String accessTokenString = "Bearer " + OAuthUtil.getOAuthToken(backendHTTPURL, backendHTTPSURL);
client = new RestClient(backendHTTPSURL, Constants.APPLICATION_JSON, accessTokenString);
}
Aggregations