use of org.wso2.iot.integration.common.IOTResponse in project product-iots by wso2.
the class RoleManagement method testUpdateRolePermission.
@Test(description = "Test update permission role.", dependsOnMethods = { "testAddRole" })
public void testUpdateRolePermission() throws FileNotFoundException {
IOTResponse response = client.put(Constants.RoleManagement.ROLE_MANAGEMENT_END_POINT + "/" + ROLE_NAME, PayloadGenerator.getJsonPayload(Constants.RoleManagement.ROLE_PAYLOAD_FILE_NAME, Constants.HTTP_METHOD_PUT).toString());
Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
}
use of org.wso2.iot.integration.common.IOTResponse in project product-iots by wso2.
the class RoleManagement method testAddRole.
@Test(description = "Test add role.")
public void testAddRole() throws FileNotFoundException {
IOTResponse response = client.post(Constants.RoleManagement.ROLE_MANAGEMENT_END_POINT, PayloadGenerator.getJsonPayload(Constants.RoleManagement.ROLE_PAYLOAD_FILE_NAME, Constants.HTTP_METHOD_POST).toString());
Assert.assertEquals(HttpStatus.SC_CREATED, response.getStatus());
}
use of org.wso2.iot.integration.common.IOTResponse in project product-iots by wso2.
the class RoleManagement method testGetRolePermissions.
@Test(description = "Test getting permissions of a role.", dependsOnMethods = { "testGetFilteredRoles" })
public void testGetRolePermissions() throws FileNotFoundException {
IOTResponse response = client.get(Constants.RoleManagement.ROLE_MANAGEMENT_END_POINT + "/" + ROLE_NAME + "/permissions");
Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
}
use of org.wso2.iot.integration.common.IOTResponse in project product-iots by wso2.
the class MobileDeviceManagementWithNoDevices method testCountDevicesWithNoDevices.
@Test(description = "Test count devices with no added devices")
public void testCountDevicesWithNoDevices() throws Exception {
IOTResponse response = client.get(Constants.MobileDeviceManagement.GET_DEVICE_COUNT_ENDPOINT);
Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
Assert.assertEquals(Constants.MobileDeviceManagement.NO_DEVICE, response.getBody());
}
use of org.wso2.iot.integration.common.IOTResponse in project product-iots by wso2.
the class RoleManagement method testGetFilteredRoles.
@Test(description = "Test getting roles that has particular prefix.", dependsOnMethods = { "testGetRoles" })
public void testGetFilteredRoles() throws FileNotFoundException {
IOTResponse response = client.get(Constants.RoleManagement.ROLE_MANAGEMENT_END_POINT + "/filter/administ?offset=0&limit=2");
Assert.assertEquals(HttpStatus.SC_OK, response.getStatus());
AssertUtil.jsonPayloadCompare(PayloadGenerator.getJsonPayload(Constants.RoleManagement.ROLE_RESPONSE_PAYLOAD_FILE_NAME, Constants.RoleManagement.GET_FILTERED_ROLED_METHOD).toString(), response.getBody(), true);
}
Aggregations