diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-09-23 15:33:41 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-09-28 17:36:49 +0200 |
commit | 4001c8d81a33d6f090d21dde02fb1facd692c4c4 (patch) | |
tree | 84bcf005edad15963a65a77118b2dfcd3d3e5cad /it | |
parent | 4cd20ab6fd2459a5c29483479c15d7c37119e90d (diff) | |
download | sonarqube-4001c8d81a33d6f090d21dde02fb1facd692c4c4.tar.gz sonarqube-4001c8d81a33d6f090d21dde02fb1facd692c4c4.zip |
SONAR-8173 delete existing permissions "shareDashboard" from db
Diffstat (limited to 'it')
4 files changed, 2 insertions, 178 deletions
diff --git a/it/it-tests/src/test/java/it/authorisation/DashboardSharingPermissionTest.java b/it/it-tests/src/test/java/it/authorisation/DashboardSharingPermissionTest.java index 63a8146615b..9eb3496f0b1 100644 --- a/it/it-tests/src/test/java/it/authorisation/DashboardSharingPermissionTest.java +++ b/it/it-tests/src/test/java/it/authorisation/DashboardSharingPermissionTest.java @@ -27,7 +27,6 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Test; -import org.sonarqube.ws.client.permission.AddUserWsRequest; import org.sonarqube.ws.client.permission.PermissionsService; import util.user.UserRule; @@ -43,7 +42,6 @@ public class DashboardSharingPermissionTest { static String DASHBOARD_USER = "dashboard_user"; static String CAN_SHARE_DASHBOARDS = "can_share_dashboards"; - static String CANNOT_SHARE_DASHBOARDS = "cannot_share_dashboards"; static PermissionsService permissionsWsClient; @@ -55,12 +53,6 @@ public class DashboardSharingPermissionTest { userRule.createUser(DASHBOARD_USER, "password"); userRule.createUser(CAN_SHARE_DASHBOARDS, "password"); - userRule.createUser(CANNOT_SHARE_DASHBOARDS, "password"); - - permissionsWsClient.addUser(new AddUserWsRequest() - .setLogin(CAN_SHARE_DASHBOARDS) - .setPermission("shareDashboard") - ); } @AfterClass @@ -79,8 +71,7 @@ public class DashboardSharingPermissionTest { @Test public void share_global_dashboard() throws Exception { Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("global-dashboard-sharing-permission", - "/authorisation/DashboardSharingPermissionTest/global-dashboard-sharing-allowed.html", - "/authorisation/DashboardSharingPermissionTest/global-dashboard-sharing-denied.html") + "/authorisation/DashboardSharingPermissionTest/global-dashboard-sharing-allowed.html") .build(); orchestrator.executeSelenese(selenese); } diff --git a/it/it-tests/src/test/java/it/authorisation/SystemAdminPermissionTest.java b/it/it-tests/src/test/java/it/authorisation/SystemAdminPermissionTest.java index af310ada96f..383d2f0cd17 100644 --- a/it/it-tests/src/test/java/it/authorisation/SystemAdminPermissionTest.java +++ b/it/it-tests/src/test/java/it/authorisation/SystemAdminPermissionTest.java @@ -26,12 +26,8 @@ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Test; -import org.sonarqube.ws.client.permission.AddUserWsRequest; -import org.sonarqube.ws.client.permission.PermissionsService; import util.user.UserRule; -import static util.ItUtils.newAdminWsClient; - public class SystemAdminPermissionTest { @ClassRule @@ -44,11 +40,7 @@ public class SystemAdminPermissionTest { public static void setUpUsers() { orchestrator.resetData(); - PermissionsService permissionsWsClient = newAdminWsClient(orchestrator).permissions(); - userRule.createUser("can_share", "password"); - permissionsWsClient.addUser(new AddUserWsRequest().setLogin("can_share").setPermission("shareDashboard")); - userRule.createUser("cannot_share", "password"); } @@ -77,8 +69,7 @@ public class SystemAdminPermissionTest { @Test public void should_change_ownership_of_shared_global_dashboard() throws Exception { seleniumSuite("change-global-dashboard-ownership", - "/authorisation/SystemAdminPermissionTest/change-shared-global-dashboard-owner.html", - "/authorisation/SystemAdminPermissionTest/change-shared-global-dashboard-owner-failure.html"); + "/authorisation/SystemAdminPermissionTest/change-shared-global-dashboard-owner.html"); } private void seleniumSuite(String suiteName, String... tests) { diff --git a/it/it-tests/src/test/resources/authorisation/DashboardSharingPermissionTest/global-dashboard-sharing-denied.html b/it/it-tests/src/test/resources/authorisation/DashboardSharingPermissionTest/global-dashboard-sharing-denied.html deleted file mode 100644 index 571c287cddb..00000000000 --- a/it/it-tests/src/test/resources/authorisation/DashboardSharingPermissionTest/global-dashboard-sharing-denied.html +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> - <title>global-dashboard-sharing-permission</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> - <tbody> - <tr> - <td>open</td> - <td>/sessions/logout</td> - <td></td> - </tr> - <tr> - <td>open</td> - <td>/dashboards</td> - <td></td> - </tr> - <tr> - <td>type</td> - <td>id=login</td> - <td>cannot_share_dashboards</td> - </tr> - <tr> - <td>type</td> - <td>id=password</td> - <td>password</td> - </tr> - <tr> - <td>clickAndWait</td> - <td>name=commit</td> - <td></td> - </tr> - <tr> - <td>click</td> - <td>create-link-dashboard</td> - <td></td> - </tr> - <tr> - <td>waitForVisible</td> - <td>css=div.modal-body</td> - <td></td> - </tr> - <tr> - <td>assertElementNotPresent</td> - <td>css=div.modal-body > div.modal.field > input#shared</td> - <td></td> - </tr> - </tbody> -</table> -</body> -</html> diff --git a/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-shared-global-dashboard-owner-failure.html b/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-shared-global-dashboard-owner-failure.html deleted file mode 100644 index b3a6b718f3a..00000000000 --- a/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-shared-global-dashboard-owner-failure.html +++ /dev/null @@ -1,104 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> - <title>change-shared-global-dashboard-owner</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> - <tbody> - <tr> - <td>open</td> - <td>/sessions/logout</td> - <td></td> - </tr> - <tr> - <td>open</td> - <td>/dashboards</td> - <td></td> - </tr> - <tr> - <td>type</td> - <td>login</td> - <td>admin</td> - </tr> - <tr> - <td>type</td> - <td>password</td> - <td>admin</td> - </tr> - <tr> - <td>clickAndWait</td> - <td>commit</td> - <td></td> - </tr> - <tr> - <td>click</td> - <td>create-link-dashboard</td> - <td></td> - </tr> - <tr> - <td>waitForVisible</td> - <td>css=div.modal-body</td> - <td></td> - </tr> - <tr> - <td>type</td> - <td>name</td> - <td>shared-global-dashboard-fail</td> - </tr> - <tr> - <td>storeValue</td> - <td>name</td> - <td>DASHBOARD_NAME</td> - </tr> - <tr> - <td>click</td> - <td>name=shared</td> - <td></td> - </tr> - <tr> - <td>clickAndWait</td> - <td>save-submit</td> - <td></td> - </tr> - <tr> - <td>waitForVisible</td> - <td>edit-${DASHBOARD_NAME}</td> - <td></td> - </tr> - <tr> - <td>click</td> - <td>edit-${DASHBOARD_NAME}</td> - <td></td> - </tr> - <tr> - <td>waitForVisible</td> - <td>css=div.modal-body</td> - <td></td> - </tr> - <tr> - <td>type</td> - <td>select-dashboard-owner</td> - <td>cannot_share</td> - </tr> - <tr> - <td>click</td> - <td>save-submit</td> - <td></td> - </tr> - <tr> - <td>waitForVisible</td> - <td>css=div.modal-body > p.error</td> - <td></td> - </tr> - <tr> - <td>waitForText</td> - <td>css=div.modal-body > p.error</td> - <td>glob:*User cannot own this dashboard because of insufficient rights*</td> - </tr> - </tbody> -</table> -</body> -</html> |