From a1688140c5c8499541cfd24c83d9d5fe8d967d28 Mon Sep 17 00:00:00 2001 From: megala21 Date: Sat, 29 Apr 2017 22:23:01 +0530 Subject: [PATCH] Adding notification management jmeter script --- ...tificationManagementAPIJMeterTestCase.java | 28 + .../jmeter-scripts/GroupManagementAPI.jmx | 212 +++ .../NewAndroidDeviceManagementAPI.jmx | 158 ++ .../NotificationManagementAPI.jmx | 1693 +++++++++++++++++ .../src/test/resources/testng.xml | 5 + pom.xml | 2 +- 6 files changed, 2097 insertions(+), 1 deletion(-) create mode 100644 modules/integration/tests-integration/src/test/java/org/wso2/iot/integration/jmeter/NotificationManagementAPIJMeterTestCase.java create mode 100644 modules/integration/tests-integration/src/test/resources/jmeter-scripts/NotificationManagementAPI.jmx diff --git a/modules/integration/tests-integration/src/test/java/org/wso2/iot/integration/jmeter/NotificationManagementAPIJMeterTestCase.java b/modules/integration/tests-integration/src/test/java/org/wso2/iot/integration/jmeter/NotificationManagementAPIJMeterTestCase.java new file mode 100644 index 00000000..89025317 --- /dev/null +++ b/modules/integration/tests-integration/src/test/java/org/wso2/iot/integration/jmeter/NotificationManagementAPIJMeterTestCase.java @@ -0,0 +1,28 @@ +package org.wso2.iot.integration.jmeter; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.testng.annotations.Test; +import org.wso2.carbon.automation.engine.exceptions.AutomationFrameworkException; +import org.wso2.carbon.automation.extensions.jmeter.JMeterTest; +import org.wso2.carbon.automation.extensions.jmeter.JMeterTestManager; + +import java.io.File; +import java.net.URL; + +/** + * This class tests the Notification Management APIs + */ +public class NotificationManagementAPIJMeterTestCase { + private static Log log = LogFactory.getLog(NotificationManagementAPIJMeterTestCase.class); + + @Test(description = "This test case tests the Notification Management APIs") + public void NotificationManagementTest() throws AutomationFrameworkException { + URL url = Thread.currentThread().getContextClassLoader() + .getResource("jmeter-scripts" + File.separator + "NotificationManagementAPI.jmx"); + JMeterTest script = new JMeterTest(new File(url.getPath())); + JMeterTestManager manager = new JMeterTestManager(); + log.info("Running notification management api test cases using jmeter scripts"); + manager.runTest(script); + } +} diff --git a/modules/integration/tests-integration/src/test/resources/jmeter-scripts/GroupManagementAPI.jmx b/modules/integration/tests-integration/src/test/resources/jmeter-scripts/GroupManagementAPI.jmx index 753f5eb1..cac784a5 100644 --- a/modules/integration/tests-integration/src/test/resources/jmeter-scripts/GroupManagementAPI.jmx +++ b/modules/integration/tests-integration/src/test/resources/jmeter-scripts/GroupManagementAPI.jmx @@ -1968,6 +1968,112 @@ vars.put("base64encodedId",new String(encryptedId)); + + + + + ${host} + ${https_port} + + + https + + /api/device-mgt/v1.0/admin/groups + GET + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + 200 + + Assertion.response_code + false + 2 + + + + false + groupCount + "count":(.+?) + $1$ + 0 + 1 + + + + + + + + ${host} + ${https_port} + + + https + + /api/device-mgt/v1.0/admin/groups/count + GET + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + 200 + + Assertion.response_code + false + 2 + + + + + ${groupCount} + + Assertion.response_data + false + 8 + + + true @@ -3715,6 +3821,112 @@ vars.put("base64encodedId",new String(encryptedId)); + + + + + ${host} + ${https_port} + + + https + + /api/device-mgt/v1.0/admin/groups + GET + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + 200 + + Assertion.response_code + false + 2 + + + + false + groupCount + "count":(.+?) + $1$ + 0 + 1 + + + + + + + + ${host} + ${https_port} + + + https + + /api/device-mgt/v1.0/admin/groups/count + GET + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + 200 + + Assertion.response_code + false + 2 + + + + + ${groupCount} + + Assertion.response_data + false + 8 + + + true diff --git a/modules/integration/tests-integration/src/test/resources/jmeter-scripts/NewAndroidDeviceManagementAPI.jmx b/modules/integration/tests-integration/src/test/resources/jmeter-scripts/NewAndroidDeviceManagementAPI.jmx index 46e6d06a..1bc60a8e 100644 --- a/modules/integration/tests-integration/src/test/resources/jmeter-scripts/NewAndroidDeviceManagementAPI.jmx +++ b/modules/integration/tests-integration/src/test/resources/jmeter-scripts/NewAndroidDeviceManagementAPI.jmx @@ -911,6 +911,85 @@ GEL4ZNjZ+jnwSkzwBU5vh/QS", + + true + + + + false + { + "serial": "qwe12-23fdf-2s332-53fv3-sfs33", + "pem": " +MIIEXjCCA0agAwIBAgIJAPocSteC87XUMA0GCSqGSIb3DQEBBQUAMHwxCzAJBgNV +BAYTAlNMMRAwDgYDVQQIEwdDb2xvbWJvMRAwDgYDVQQHEwdDb2xvbWJvMRIwEAYD +VQQKEwlXU08yIEluYy4xHzAdBgkqhkiG9w0BCQEWEHRlY2hvcHNAd3NvMi5jb20x +FDASBgNVBAMTC1dTTzIgUmFkaXVzMB4XDTEzMDYyNzAzMzA0NFoXDTIzMDYyNTAz +MzA0NFowfDELMAkGA1UEBhMCU0wxEDAOBgNVBAgTB0NvbG9tYm8xEDAOBgNVBAcT +B0NvbG9tYm8xEjAQBgNVBAoTCVdTTzIgSW5jLjEfMB0GCSqGSIb3DQEJARYQdGVj +aG9wc0B3c28yLmNvbTEUMBIGA1UEAxMLV1NPMiBSYWRpdXMwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQDNmhw12cF0H2UGE/XtWVt238oGxn19+n/HkM2B +cDNQgnStqI+g/K2HBtjmvVPBh17Mt+dU2BIathn06amza+LI+hHgeLUSv30jutv4 +L5zD2laAU9A/I0Wtrxu5FlsevRPSiY7buLjTbjP7IMn9vdwb+9nBQCGxVpO6AK2A +gsFJ5udnp7L+jNsHmHFt36AYZouihgD+/RGVLBAhtPoU6XFB1JoGFM+4qxklJLPh +k86WollG4cFvHXSbO1P95n6Jb/V3hfM0PvwFZswRPVnW8ngqm889C/JEk5rK4FHy +xk9MgeFRW6zA+3rVnyPdhy6/q4EerBLMfBEWpzFHyHDKMGanAgMBAAGjgeIwgd8w +HQYDVR0OBBYEFKRxtF0CWPwL7jRvA4NSIzploUgrMIGvBgNVHSMEgacwgaSAFKRx +tF0CWPwL7jRvA4NSIzploUgroYGApH4wfDELMAkGA1UEBhMCU0wxEDAOBgNVBAgT +B0NvbG9tYm8xEDAOBgNVBAcTB0NvbG9tYm8xEjAQBgNVBAoTCVdTTzIgSW5jLjEf +MB0GCSqGSIb3DQEJARYQdGVjaG9wc0B3c28yLmNvbTEUMBIGA1UEAxMLV1NPMiBS +YWRpdXOCCQD6HErXgvO11DAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IB +AQCDQV9wy8rfuFp4uByqYhnrQjzBN75VbNcgpdYocOxQPLnjWRM5qdJHELrt4FEl +rDMGd1BpP7QMAEYJUIcpDHPbs9HVCeEV6hdOrLgGxNDB0YVa2Fr5k2U8gsNIgKZo +fKxscx0w5OM71IQbuppAgIHK29DBVBVppO+zduIbVtSoBo/gcVIqVGXQXf8TFtoV +xyfGUTYdBDP4fT4p8uLASXmdaFyegQOhkjSuchVPGSJOZD6TvOjE6ZvBu9eC7sqh +oTPY56Ld0GscWJmAuj+8vmWGu0md8MnM2DE0SIYE3bo/sPp3yEIbCAnHmcveG8hn +GEL4ZNjZ+jnwSkzwBU5vh/QS", + "tenantId": 0 + } + = + + + + ${host} + ${https_port} + + + https + + /api/certificate-mgt/v1.0/admin/certificates/verify/android + POST + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + "invalid" + + Assertion.response_data + false + 16 + + + @@ -5008,6 +5087,85 @@ GEL4ZNjZ+jnwSkzwBU5vh/QS", + + true + + + + false + { + "serial": "qwe12-23fdf-2s332-53fv3-sfs33", + "pem": " +MIIEXjCCA0agAwIBAgIJAPocSteC87XUMA0GCSqGSIb3DQEBBQUAMHwxCzAJBgNV +BAYTAlNMMRAwDgYDVQQIEwdDb2xvbWJvMRAwDgYDVQQHEwdDb2xvbWJvMRIwEAYD +VQQKEwlXU08yIEluYy4xHzAdBgkqhkiG9w0BCQEWEHRlY2hvcHNAd3NvMi5jb20x +FDASBgNVBAMTC1dTTzIgUmFkaXVzMB4XDTEzMDYyNzAzMzA0NFoXDTIzMDYyNTAz +MzA0NFowfDELMAkGA1UEBhMCU0wxEDAOBgNVBAgTB0NvbG9tYm8xEDAOBgNVBAcT +B0NvbG9tYm8xEjAQBgNVBAoTCVdTTzIgSW5jLjEfMB0GCSqGSIb3DQEJARYQdGVj +aG9wc0B3c28yLmNvbTEUMBIGA1UEAxMLV1NPMiBSYWRpdXMwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQDNmhw12cF0H2UGE/XtWVt238oGxn19+n/HkM2B +cDNQgnStqI+g/K2HBtjmvVPBh17Mt+dU2BIathn06amza+LI+hHgeLUSv30jutv4 +L5zD2laAU9A/I0Wtrxu5FlsevRPSiY7buLjTbjP7IMn9vdwb+9nBQCGxVpO6AK2A +gsFJ5udnp7L+jNsHmHFt36AYZouihgD+/RGVLBAhtPoU6XFB1JoGFM+4qxklJLPh +k86WollG4cFvHXSbO1P95n6Jb/V3hfM0PvwFZswRPVnW8ngqm889C/JEk5rK4FHy +xk9MgeFRW6zA+3rVnyPdhy6/q4EerBLMfBEWpzFHyHDKMGanAgMBAAGjgeIwgd8w +HQYDVR0OBBYEFKRxtF0CWPwL7jRvA4NSIzploUgrMIGvBgNVHSMEgacwgaSAFKRx +tF0CWPwL7jRvA4NSIzploUgroYGApH4wfDELMAkGA1UEBhMCU0wxEDAOBgNVBAgT +B0NvbG9tYm8xEDAOBgNVBAcTB0NvbG9tYm8xEjAQBgNVBAoTCVdTTzIgSW5jLjEf +MB0GCSqGSIb3DQEJARYQdGVjaG9wc0B3c28yLmNvbTEUMBIGA1UEAxMLV1NPMiBS +YWRpdXOCCQD6HErXgvO11DAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IB +AQCDQV9wy8rfuFp4uByqYhnrQjzBN75VbNcgpdYocOxQPLnjWRM5qdJHELrt4FEl +rDMGd1BpP7QMAEYJUIcpDHPbs9HVCeEV6hdOrLgGxNDB0YVa2Fr5k2U8gsNIgKZo +fKxscx0w5OM71IQbuppAgIHK29DBVBVppO+zduIbVtSoBo/gcVIqVGXQXf8TFtoV +xyfGUTYdBDP4fT4p8uLASXmdaFyegQOhkjSuchVPGSJOZD6TvOjE6ZvBu9eC7sqh +oTPY56Ld0GscWJmAuj+8vmWGu0md8MnM2DE0SIYE3bo/sPp3yEIbCAnHmcveG8hn +GEL4ZNjZ+jnwSkzwBU5vh/QS", + "tenantId": 0 + } + = + + + + ${host} + ${https_port} + + + https + + /api/certificate-mgt/v1.0/admin/certificates/verify/android + POST + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + "invalid" + + Assertion.response_data + false + 16 + + + diff --git a/modules/integration/tests-integration/src/test/resources/jmeter-scripts/NotificationManagementAPI.jmx b/modules/integration/tests-integration/src/test/resources/jmeter-scripts/NotificationManagementAPI.jmx new file mode 100644 index 00000000..ced0e6a2 --- /dev/null +++ b/modules/integration/tests-integration/src/test/resources/jmeter-scripts/NotificationManagementAPI.jmx @@ -0,0 +1,1693 @@ + + + + + + false + false + + + + + + + + 9999 + 100 + + false + + randAppNum + + + + + + host + localhost + = + + + https_port + 8243 + = + + + http_port + 8280 + = + + + token_ep_host + localhost + = + + + token_ep_port + 8280 + = + + + group_name + Group 2 + = + + + new_group_name + New Group + = + + + role_name + group_sharing + = + + + DeviceID + 20 + = + + + DeviceIdentifier + notifiction_device + = + + + tenant_user_name + admin + Name of Tenant + = + + + domain_name + wso2.com + Name of Domain + = + + + password + admin + Password + = + + + email + abc@wso2.com + Email + = + + + firstName + firstName + First Name + = + + + lastName + lastName + Last Name + = + + + usagePlan + Demo + Usage Plan + = + + + createdDate + 2013-02-22T08:22:35+05:30 + Created Date + = + + + management_https_port + 9443 + Port for carbon management console + = + + + + + + continue + + false + 1 + + 1 + + 1342532280000 + 1342532280000 + false + + + + + + + false + rfc2109 + + + + + + + https://${host}:${management_https_port}/services/AuthenticationAdmin.AuthenticationAdminHttpsSoap11Endpoint/ + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aut="http://authentication.services.core.carbon.wso2.org"> + <soapenv:Header/> + <soapenv:Body> + <aut:login> + <!--Optional:--> + <aut:username>admin</aut:username> + <!--Optional:--> + <aut:password>admin</aut:password> + <!--Optional:--> + <aut:remoteAddress>127.0.0.1</aut:remoteAddress> + </aut:login> + </soapenv:Body> +</soapenv:Envelope> + + urn:login + true + false + + + + + + + https://${host}:${management_https_port}/services/TenantMgtAdminService.TenantMgtAdminServiceHttpsSoap11Endpoint/ + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.mgt.tenant.carbon.wso2.org"> + <soapenv:Header/> + <soapenv:Body> + <ser:getTenant> + <!--Optional:--> + <ser:tenantDomain>${domain_name}</ser:tenantDomain> + </ser:getTenant> + </soapenv:Body> +</soapenv:Envelope> + + urn:getTenant + true + false + + + + undefined + tenant_exists + //*[local-name()='active']/text() + false + false + true + tenant_exists + + + + false + true + true + false + + + + + ${tenant_exists}==false + false + + + + + + + https://${host}:${management_https_port}/services/TenantMgtAdminService.TenantMgtAdminServiceHttpsSoap11Endpoint/ + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.mgt.tenant.carbon.wso2.org" xmlns:xsd="http://beans.common.stratos.carbon.wso2.org/xsd"> + <soapenv:Header/> + <soapenv:Body> + <ser:addTenant> + <!--Optional:--> + <ser:tenantInfoBean> + <!--Optional:--> + <xsd:active>1</xsd:active> + <!--Optional:--> + <xsd:admin>${tenant_user_name}</xsd:admin> + <!--Optional:--> + <xsd:adminPassword>${password}</xsd:adminPassword> + <!--Optional:--> + <xsd:createdDate>${createdDate}</xsd:createdDate> + <!--Optional:--> + <xsd:email>${email}</xsd:email> + <!--Optional:--> + <xsd:firstname>${firstName}</xsd:firstname> + <!--Optional:--> + <xsd:lastname>${lastName}</xsd:lastname> + <!--Optional:--> + <xsd:tenantDomain>${domain_name}</xsd:tenantDomain> + <!--Optional:--> + <xsd:tenantId>0</xsd:tenantId> + <!--Optional:--> + <xsd:usagePlan>${usagePlan}</xsd:usagePlan> + </ser:tenantInfoBean> + </ser:addTenant> + </soapenv:Body> +</soapenv:Envelope> + + urn:addTenant + true + false + + + + + + + + https://${host}:${management_https_port}/services/AuthenticationAdmin.AuthenticationAdminHttpsSoap11Endpoint/ + <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aut="http://authentication.services.core.carbon.wso2.org"> + <soapenv:Header/> + <soapenv:Body> + <aut:logout/> + </soapenv:Body> +</soapenv:Envelope> + + urn:logout + true + false + + + + + 202 + + Assertion.response_code + false + 1 + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + true + false + false + false + false + false + 0 + true + + + /home/ace/Desktop/results_multi_user_multi_tenancy.jtl + + + + + continue + + false + 1 + + 1 + 1 + 1465464058000 + 1465464058000 + false + + + + + + true + + + + false + { + "applicationName":"app_${randAppNum}", + "isAllowedToAllDomains":false, + "tags":["android", "device_management"], + "isMappingAnExistingOAuthApp":false +} + = + + + + ${host} + ${https_port} + + + https + + /api-application-registration/register + POST + true + false + true + false + HttpClient4 + false + + + + + + + Authorization + Basic YWRtaW46YWRtaW4= + + + Host + localhost:9763 + + + Content-Type + application/json + + + + + + false + clientId + "client_id":"(.+?)" + $1$ + 0 + 1 + + + + false + clientSecret + "client_secret":"(.+?)" + $1$ + 0 + 1 + + + + + + clientId,clientSecret + false + import org.apache.commons.codec.binary.Base64; + +String clientId= vars.get("clientId"); +String clientSecret = vars.get("clientSecret"); +String toEncode = clientId + ":" + clientSecret; + +byte[] encryptedId = Base64.encodeBase64(toEncode.getBytes()); +vars.put("base64encodedId",new String(encryptedId)); + + + + + + + false + admin + = + true + username + + + false + admin + = + true + password + + + false + password + = + true + grant_type + + + false + perm:android:enroll perm:android:wipe perm:android:ring perm:android:lock-devices perm:android:configure-vpn perm:android:configure-wifi perm:android:enroll perm:android:uninstall-application perm:android:manage-configuration perm:android:location perm:android:install-application perm:android:mute perm:android:change-lock-code perm:android:blacklist-applications perm:android:set-password-policy perm:android:encrypt-storage perm:android:clear-password perm:android:enterprise-wipe perm:android:info perm:android:view-configuration perm:android:upgrade-firmware perm:android:set-webclip perm:android:send-notification perm:android:disenroll perm:android:update-application perm:android:unlock-devices perm:android:control-camera perm:android:reboot perm:android:logcat appm:subscribe perm:sign-csr perm:admin:devices:view perm:roles:add perm:roles:add-users perm:roles:update perm:roles:permissions perm:roles:details perm:roles:view perm:roles:create-combined-role perm:roles:delete perm:dashboard:vulnerabilities perm:dashboard:non-compliant-count perm:dashboard:non-compliant perm:dashboard:by-groups perm:dashboard:device-counts perm:dashboard:feature-non-compliant perm:dashboard:count-overview perm:dashboard:filtered-count perm:dashboard:details perm:get-activity perm:devices:delete perm:devices:applications perm:devices:effective-policy perm:devices:compliance-data perm:devices:features perm:devices:operations perm:devices:search perm:devices:details perm:devices:update perm:devices:view perm:view-configuration perm:manage-configuration perm:policies:remove perm:policies:priorities perm:policies:deactivate perm:policies:get-policy-details perm:policies:manage perm:policies:activate perm:policies:update perm:policies:changes perm:policies:get-details perm:users:add perm:users:details perm:users:count perm:users:delete perm:users:roles perm:users:user-details perm:users:credentials perm:users:search perm:users:is-exist perm:users:update perm:users:send-invitation perm:admin-users:view perm:groups:devices perm:groups:update perm:groups:add perm:groups:device perm:groups:devices-count perm:groups:remove perm:groups:groups perm:groups:groups-view perm:groups:share perm:groups:count perm:groups:roles perm:groups:devices-remove perm:groups:devices-add perm:groups:assign perm:device-types:features perm:device-types:types perm:applications:install perm:applications:uninstall perm:admin-groups:count perm:admin-groups:view perm:notifications:mark-checked perm:notifications:view perm:admin:certificates:delete perm:admin:certificates:details perm:admin:certificates:view perm:admin:certificates:add perm:admin:certificates:verify perm:ios:enroll perm:ios:view-device perm:ios:apn perm:ios:ldap perm:ios:enterprise-app perm:ios:store-application perm:ios:remove-application perm:ios:app-list perm:ios:profile-list perm:ios:lock perm:ios:enterprise-wipe perm:ios:device-info perm:ios:restriction perm:ios:email perm:ios:cellular perm:ios:applications perm:ios:wifi perm:ios:ring perm:ios:location perm:ios:notification perm:ios:airplay perm:ios:caldav perm:ios:cal-subscription perm:ios:passcode-policy perm:ios:webclip perm:ios:vpn perm:ios:per-app-vpn perm:ios:app-to-per-app-vpn perm:ios:app-lock perm:ios:clear-passcode perm:ios:remove-profile perm:ios:get-restrictions perm:ios:wipe-data perm:admin perm:android:applications + = + true + scope + + + false + + = + true + + + + + ${host} + ${https_port} + + + https + + /token + POST + true + false + true + false + HttpClient4 + false + + + + + + + Authorization + Basic ${base64encodedId} + + + Content-Type + application/x-www-form-urlencoded + + + + + + false + access_token + "access_token":"(.+?)" + $1$ + no_token + 1 + + + + + true + + + + false + { + "id":1000${DeviceID}, + "name":"androiddevice${DeviceID}", + "type":"android", + "description":"this is an android device", + "deviceIdentifier":"${DeviceIdentifier}", + "enrolmentInfo":{ + "id":1000${DeviceID}, + "device":{ + + }, + "dateOfEnrolment":0, + "dateOfLastUpdate":0, + "ownership":"BYOD", + "status":"CREATED", + "owner":"admin" + }, + "features":[ + { + "id":10, + "code":"aaaa1111", + "name":"newfeature1", + "description":"this is the new feature 1", + "deviceType":"android", + "metadataEntries":[ + { + "id":10, + "value":{ + + } + } + ] + } + ], + "properties":[ + { + "name":"property1", + "value":"value1" + } + ], + "deviceInfo":{ + "deviceModel":"S6", + "vendor":"SAMSUNG", + "osVersion":"5.1", + "batteryLevel":1, + "internalTotalMemory":32, + "internalAvailableMemory":24, + "externalTotalMemory":64, + "externalAvailableMemory":60, + "operator":"dialog", + "connectionType":"GSM", + "mobileSignalStrength":1, + "ssid":"picassowifi", + "cpuUsage":0, + "totalRAMMemory":2, + "availableRAMMemory":1, + "pluggedIn":false, + "location":{ + "deviceId":0, + "deviceIdentifier":{ + "id":"string", + "type":"string" + }, + "latitude":0, + "longitude":0, + "street1":"string", + "street2":"string", + "city":"string", + "state":"string", + "zip":"string", + "country":"string" + }, + "deviceDetailsMap":{ + + }, + "imei":"string", + "imsi":"string" + }, + "applications":[ + { + "id":0, + "platform":"string", + "category":"string", + "name":"string", + "locationUrl":"string", + "imageUrl":"string", + "version":"string", + "type":"string", + "appProperties":{ + + }, + "applicationIdentifier":"string", + "memoryUsage":0 + } + ] +} + = + + + + ${host} + ${https_port} + + + https + + /api/device-mgt/android/v1.0/devices + POST + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + 200 + + Assertion.response_code + false + 2 + + + + + true + + + + false + ["${DeviceIdentifier}"] + = + + + + ${host} + ${https_port} + + + https + + /api/device-mgt/android/v1.0/admin/devices/location + POST + true + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + Accept + application/json + + + + + + + true + + + + false + [{"enabled":false,"code":"DEVICE_LOCATION","type":"COMMAND","id":1,"status":"ERROR","createdTimeStamp":"2016-08-03 12:59:05.927","isEnabled":false}] + = + + + + ${host} + ${https_port} + + + https + UTF-8 + /api/device-mgt/android/v1.0/devices/${DeviceIdentifier}/pending-operations + PUT + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + + + + ${host} + ${https_port} + + + https + + /api/device-mgt/v1.0/notifications + GET + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + 200 + + Assertion.response_code + false + 2 + + + + + "DEVICE_LOCATION operation did fail to execute on device androiddevice${DeviceID} with identifier notifiction_device" + + Assertion.response_data + false + 16 + + + + false + notificationId + "id":(.+?) + $1$ + 0 + 1 + + + + + + + + ${host} + ${https_port} + + + https + UTF-8 + /api/device-mgt/v1.0/notifications/${notificationId}/mark-checked + PUT + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + 200 + + Assertion.response_code + false + 2 + + + + + "NEW" + + Assertion.response_data + false + 20 + + + + + "CHECKED" + + Assertion.response_data + false + 2 + + + + + + + + ${host} + ${https_port} + + + https + + /api/device-mgt/v1.0/notifications + GET + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + 200 + + Assertion.response_code + false + 2 + + + + + "CHECKED" + + Assertion.response_data + false + 2 + + + + + + tenant_user_name,domain_name,password + false + import org.apache.commons.codec.binary.Base64; + +String tenant_user= vars.get("tenant_user_name") + "@" + vars.get("domain_name") ; +String password= vars.get("password"); +String toEncode = tenant_user + ":" + password; + +byte[] encryptedId = Base64.encodeBase64(toEncode.getBytes()); +vars.put("encodedUserPassword","Basic " + new String(encryptedId)); + + + + true + + + + false + { + "applicationName":"app_hello", + "isAllowedToAllDomains":false, + "tags":["android", "device_management"], + "isMappingAnExistingOAuthApp":false +} + = + + + + ${host} + ${https_port} + + + https + + /api-application-registration/register + POST + true + false + true + false + HttpClient4 + false + + + + + + + Authorization + ${encodedUserPassword} + + + Host + localhost:9763 + + + Content-Type + application/json + + + + + + false + clientId + "client_id":"(.+?)" + $1$ + 0 + 1 + + + + false + clientSecret + "client_secret":"(.+?)" + $1$ + 0 + 1 + + + + + + clientId,clientSecret + false + import org.apache.commons.codec.binary.Base64; + +String clientId= vars.get("clientId"); +String clientSecret = vars.get("clientSecret"); +String toEncode = clientId + ":" + clientSecret; + +byte[] encryptedId = Base64.encodeBase64(toEncode.getBytes()); +vars.put("base64encodedId",new String(encryptedId)); + + + + + + + false + ${tenant_user_name}@${domain_name} + = + true + username + + + false + ${password} + = + true + password + + + false + password + = + true + grant_type + + + false + perm:android:enroll perm:android:wipe perm:android:ring perm:android:lock-devices perm:android:configure-vpn perm:android:configure-wifi perm:android:enroll perm:android:uninstall-application perm:android:manage-configuration perm:android:location perm:android:install-application perm:android:mute perm:android:change-lock-code perm:android:blacklist-applications perm:android:set-password-policy perm:android:encrypt-storage perm:android:clear-password perm:android:enterprise-wipe perm:android:info perm:android:view-configuration perm:android:upgrade-firmware perm:android:set-webclip perm:android:send-notification perm:android:disenroll perm:android:update-application perm:android:unlock-devices perm:android:control-camera perm:android:reboot perm:android:logcat appm:subscribe perm:sign-csr perm:admin:devices:view perm:roles:add perm:roles:add-users perm:roles:update perm:roles:permissions perm:roles:details perm:roles:view perm:roles:create-combined-role perm:roles:delete perm:dashboard:vulnerabilities perm:dashboard:non-compliant-count perm:dashboard:non-compliant perm:dashboard:by-groups perm:dashboard:device-counts perm:dashboard:feature-non-compliant perm:dashboard:count-overview perm:dashboard:filtered-count perm:dashboard:details perm:get-activity perm:devices:delete perm:devices:applications perm:devices:effective-policy perm:devices:compliance-data perm:devices:features perm:devices:operations perm:devices:search perm:devices:details perm:devices:update perm:devices:view perm:view-configuration perm:manage-configuration perm:policies:remove perm:policies:priorities perm:policies:deactivate perm:policies:get-policy-details perm:policies:manage perm:policies:activate perm:policies:update perm:policies:changes perm:policies:get-details perm:users:add perm:users:details perm:users:count perm:users:delete perm:users:roles perm:users:user-details perm:users:credentials perm:users:search perm:users:is-exist perm:users:update perm:users:send-invitation perm:admin-users:view perm:groups:devices perm:groups:update perm:groups:add perm:groups:device perm:groups:devices-count perm:groups:remove perm:groups:groups perm:groups:groups-view perm:groups:share perm:groups:count perm:groups:roles perm:groups:devices-remove perm:groups:devices-add perm:groups:assign perm:device-types:features perm:device-types:types perm:applications:install perm:applications:uninstall perm:admin-groups:count perm:admin-groups:view perm:notifications:mark-checked perm:notifications:view perm:admin:certificates:delete perm:admin:certificates:details perm:admin:certificates:view perm:admin:certificates:add perm:admin:certificates:verify perm:ios:enroll perm:ios:view-device perm:ios:apn perm:ios:ldap perm:ios:enterprise-app perm:ios:store-application perm:ios:remove-application perm:ios:app-list perm:ios:profile-list perm:ios:lock perm:ios:enterprise-wipe perm:ios:device-info perm:ios:restriction perm:ios:email perm:ios:cellular perm:ios:applications perm:ios:wifi perm:ios:ring perm:ios:location perm:ios:notification perm:ios:airplay perm:ios:caldav perm:ios:cal-subscription perm:ios:passcode-policy perm:ios:webclip perm:ios:vpn perm:ios:per-app-vpn perm:ios:app-to-per-app-vpn perm:ios:app-lock perm:ios:clear-passcode perm:ios:remove-profile perm:ios:get-restrictions perm:ios:wipe-data perm:admin perm:android:applications + = + true + scope + + + false + + = + true + + + + + ${host} + ${https_port} + + + https + + /token + POST + true + false + true + false + HttpClient4 + false + + + + + + + Authorization + Basic ${base64encodedId} + + + Content-Type + application/x-www-form-urlencoded + + + + + + false + access_token + "access_token":"(.+?)" + $1$ + no_token + 1 + + + + + true + + + + false + { + "id":1000${DeviceID}, + "name":"androiddevice${DeviceID}", + "type":"android", + "description":"this is an android device", + "deviceIdentifier":"${DeviceIdentifier}", + "enrolmentInfo":{ + "id":1000${DeviceID}, + "device":{ + + }, + "dateOfEnrolment":0, + "dateOfLastUpdate":0, + "ownership":"BYOD", + "status":"CREATED", + "owner":"admin" + }, + "features":[ + { + "id":10, + "code":"aaaa1111", + "name":"newfeature1", + "description":"this is the new feature 1", + "deviceType":"android", + "metadataEntries":[ + { + "id":10, + "value":{ + + } + } + ] + } + ], + "properties":[ + { + "name":"property1", + "value":"value1" + } + ], + "deviceInfo":{ + "deviceModel":"S6", + "vendor":"SAMSUNG", + "osVersion":"5.1", + "batteryLevel":1, + "internalTotalMemory":32, + "internalAvailableMemory":24, + "externalTotalMemory":64, + "externalAvailableMemory":60, + "operator":"dialog", + "connectionType":"GSM", + "mobileSignalStrength":1, + "ssid":"picassowifi", + "cpuUsage":0, + "totalRAMMemory":2, + "availableRAMMemory":1, + "pluggedIn":false, + "location":{ + "deviceId":0, + "deviceIdentifier":{ + "id":"string", + "type":"string" + }, + "latitude":0, + "longitude":0, + "street1":"string", + "street2":"string", + "city":"string", + "state":"string", + "zip":"string", + "country":"string" + }, + "deviceDetailsMap":{ + + }, + "imei":"string", + "imsi":"string" + }, + "applications":[ + { + "id":0, + "platform":"string", + "category":"string", + "name":"string", + "locationUrl":"string", + "imageUrl":"string", + "version":"string", + "type":"string", + "appProperties":{ + + }, + "applicationIdentifier":"string", + "memoryUsage":0 + } + ] +} + = + + + + ${host} + ${https_port} + + + https + + /api/device-mgt/android/v1.0/devices + POST + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + 200 + + Assertion.response_code + false + 2 + + + + + true + + + + false + ["${DeviceIdentifier}"] + = + + + + ${host} + ${https_port} + + + https + + /api/device-mgt/android/v1.0/admin/devices/location + POST + true + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + Accept + application/json + + + + + + + true + + + + false + [{"enabled":false,"code":"DEVICE_LOCATION","type":"COMMAND","id":1,"status":"ERROR","createdTimeStamp":"2016-08-03 12:59:05.927","isEnabled":false}] + = + + + + ${host} + ${https_port} + + + https + UTF-8 + /api/device-mgt/android/v1.0/devices/${DeviceIdentifier}/pending-operations + PUT + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + + + + ${host} + ${https_port} + + + https + + /api/device-mgt/v1.0/notifications + GET + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + 200 + + Assertion.response_code + false + 2 + + + + + "DEVICE_LOCATION operation did fail to execute on device androiddevice${DeviceID} with identifier notifiction_device" + + Assertion.response_data + false + 16 + + + + false + notificationId + "id":(.+?) + $1$ + 0 + 1 + + + + + + + + ${host} + ${https_port} + + + https + UTF-8 + /api/device-mgt/v1.0/notifications/${notificationId}/mark-checked + PUT + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + 200 + + Assertion.response_code + false + 2 + + + + + "NEW" + + Assertion.response_data + false + 20 + + + + + "CHECKED" + + Assertion.response_data + false + 2 + + + + + + + + ${host} + ${https_port} + + + https + + /api/device-mgt/v1.0/notifications + GET + false + false + true + false + HttpClient4 + false + + + + + + + Authorization + Bearer ${access_token} + + + Content-Type + application/json + + + + + + + 200 + + Assertion.response_code + false + 2 + + + + + "CHECKED" + + Assertion.response_data + false + 2 + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + true + + + + + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + true + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + true + + + + + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + true + + + + + + + Results + true + false + true + false + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + true + + + + + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + false + false + false + false + false + 0 + true + true + + + + + + + + diff --git a/modules/integration/tests-integration/src/test/resources/testng.xml b/modules/integration/tests-integration/src/test/resources/testng.xml index 2d8e6ec9..07db3e63 100644 --- a/modules/integration/tests-integration/src/test/resources/testng.xml +++ b/modules/integration/tests-integration/src/test/resources/testng.xml @@ -114,6 +114,11 @@ + + + + + diff --git a/pom.xml b/pom.xml index bf587ab0..2bcd276e 100644 --- a/pom.xml +++ b/pom.xml @@ -1521,7 +1521,7 @@ - 3.0.28 + 3.0.29 6.1.80