From: Teryk Bellahsene Date: Fri, 15 Jan 2016 16:56:43 +0000 (+0100) Subject: Move WS responses at the right place X-Git-Tag: 5.4-M8~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0507b27dcd926506e09b41048a4714f601352245;p=sonarqube.git Move WS responses at the right place --- diff --git a/server/sonar-server/src/main/resources/org/sonar/server/permission/ws/search_global_permissions-example.json b/server/sonar-server/src/main/resources/org/sonar/server/permission/ws/search_global_permissions-example.json new file mode 100644 index 00000000000..3a2a854cbf7 --- /dev/null +++ b/server/sonar-server/src/main/resources/org/sonar/server/permission/ws/search_global_permissions-example.json @@ -0,0 +1,56 @@ +{ + "permissions": [ + { + "key": "admin", + "name": "Administer System", + "description": "Ability to perform all administration functions for the instance: global configuration and personalization of default dashboards.", + "usersCount": 0, + "groupsCount": 1 + }, + { + "key": "profileadmin", + "name": "Administer Quality Profiles", + "description": "Ability to perform any action on the quality profiles.", + "usersCount": 2, + "groupsCount": 0 + }, + { + "key": "gateadmin", + "name": "Administer Quality Gates", + "description": "Ability to perform any action on the quality gates.", + "usersCount": 2, + "groupsCount": 0 + }, + { + "key": "shareDashboard", + "name": "Share Dashboards And Filters", + "description": "Ability to share dashboards, issue filters and measure filters.", + "usersCount": 0, + "groupsCount": 1 + }, + { + "key": "scan", + "name": "Execute Analysis", + "description": "Ability to execute analyses, and to get all settings required to perform the analysis, even the secured ones like the scm account password, the jira account password, and so on.", + "usersCount": 0, + "groupsCount": 2 + }, + { + "key": "dryRunScan", + "name": "Execute Preview Analysis", + "description": "Ability to execute preview analysis (results are not pushed to the server). This permission does not include the ability to access secured settings such as the scm account password, the jira account password, and so on. This permission is required to execute preview analysis in Eclipse or via the Issues Report plugin.", + "usersCount": 2, + "groupsCount": 0 + }, + { + "key": "provisioning", + "name": "Provision Projects", + "description": "Ability to initialize project structure before first analysis.", + "usersCount": 1, + "groupsCount": 1 + } + ] +} + + + diff --git a/server/sonar-server/src/main/resources/org/sonar/server/permission/ws/search_project_permissions-example.json b/server/sonar-server/src/main/resources/org/sonar/server/permission/ws/search_project_permissions-example.json new file mode 100644 index 00000000000..43480d67f96 --- /dev/null +++ b/server/sonar-server/src/main/resources/org/sonar/server/permission/ws/search_project_permissions-example.json @@ -0,0 +1,98 @@ +{ + "paging": { + "pageIndex": 1, + "pageSize": 25, + "total": 4 + }, + "projects": [ + { + "id": "0bd7b1e7-91d6-439e-a607-4a3a9aad3c6a", + "key": "net.java.openjdk:jdk7", + "name": "JDK 7", + "qualifier": "TRK", + "permissions": [ + { + "key": "admin", + "usersCount": 3, + "groupsCount": 4 + }, + { + "key": "issueadmin", + "usersCount": 1, + "groupsCount": 0 + } + ] + }, + { + "id": "ce4c03d6-430f-40a9-b777-ad877c00aa4d", + "key": "clang", + "name": "Clang", + "qualifier": "TRK", + "permissions": [ + { + "key": "issueadmin", + "usersCount": 1, + "groupsCount": 0 + } + ] + }, + { + "id": "4e607bf9-7ed0-484a-946d-d58ba7dab2fb", + "key": "simon-brandhof", + "name": "Simon Brandhof", + "qualifier": "DEV", + "permissions": [ + { + "key": "admin", + "usersCount": 0, + "groupsCount": 1 + }, + { + "key": "issueadmin", + "usersCount": 1, + "groupsCount": 0 + } + ] + }, + { + "id": "752d8bfd-420c-4a83-a4e5-8ab19b13c8fc", + "key": "Java", + "name": "Java", + "qualifier": "VW", + "permissions": [ + { + "key": "admin", + "usersCount": 0, + "groupsCount": 1 + }, + { + "key": "issueadmin", + "usersCount": 1, + "groupsCount": 0 + } + ] + } + ], + "permissions": [ + { + "key": "user", + "name": "Browse", + "description": "Ability to access a project, browse its measures, and create/edit issues for it." + }, + { + "key": "admin", + "name": "Administer", + "description": "Ability to access project settings and perform administration tasks. (Users will also need \"Browse\" permission)" + }, + { + "key": "issueadmin", + "name": "Administer Issues", + "description": "Grants the permission to perform advanced editing on issues: marking an issue False Positive / Won\u0027t Fix or changing an Issue\u0027s severity. (Users will also need \"Browse\" permission)" + }, + { + "key": "codeviewer", + "name": "See Source Code", + "description": "Ability to view the project\u0027s source code. (Users will also need \"Browse\" permission)" + } + ] +} diff --git a/server/sonar-server/src/main/resources/org/sonar/server/permission/ws/template/search_templates-example.json b/server/sonar-server/src/main/resources/org/sonar/server/permission/ws/template/search_templates-example.json new file mode 100644 index 00000000000..75d69f5b497 --- /dev/null +++ b/server/sonar-server/src/main/resources/org/sonar/server/permission/ws/template/search_templates-example.json @@ -0,0 +1,76 @@ +{ + "permissionTemplates": [ + { + "id": "AU-TpxcA-iU5OvuD2FL0", + "name": "Default template for Developers", + "projectKeyPattern": ".*sonar.developer.*", + "createdAt": "2004-11-15T07:26:40+0100", + "updatedAt": "2004-11-19T22:33:20+0100", + "permissions": [ + { + "key": "user", + "usersCount": 0, + "groupsCount": 1 + } + ] + }, + { + "id": "AU-Tpxb--iU5OvuD2FLy", + "name": "Default template for Projects", + "description": "Template for new projects", + "createdAt": "2001-09-09T03:46:40+0200", + "updatedAt": "2001-09-09T03:46:40+0200", + "permissions": [ + { + "key": "admin", + "usersCount": 0, + "groupsCount": 1 + }, + { + "key": "codeviewer", + "usersCount": 1, + "groupsCount": 0 + }, + { + "key": "issueadmin", + "usersCount": 3, + "groupsCount": 0 + } + ] + }, + { + "id": "AU-TpxcA-iU5OvuD2FLz", + "name": "Default template for Views", + "description": "Template for new views", + "projectKeyPattern": ".*sonar.views.*", + "createdAt": "2001-09-09T03:46:40+0200", + "updatedAt": "2004-11-09T12:33:20+0100", + "permissions": [ + { + "key": "issueadmin", + "usersCount": 0, + "groupsCount": 3 + }, + { + "key": "user", + "usersCount": 2, + "groupsCount": 0 + } + ] + } + ], + "defaultTemplates": [ + { + "templateId": "AU-Tpxb--iU5OvuD2FLy", + "qualifier": "TRK" + }, + { + "templateId": "AU-TpxcA-iU5OvuD2FLz", + "qualifier": "VW" + }, + { + "templateId": "AU-TpxcA-iU5OvuD2FL0", + "qualifier": "DEV" + } + ] +} diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchGlobalPermissionsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchGlobalPermissionsActionTest.java index 2102f5b9fcf..6f74c51cc38 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchGlobalPermissionsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchGlobalPermissionsActionTest.java @@ -94,7 +94,7 @@ public class SearchGlobalPermissionsActionTest { String result = ws.newRequest().execute().getInput(); - assertJson(result).isSimilarTo(getClass().getResource("SearchGlobalPermissionsActionTest/search_global_permissions-example.json")); + assertJson(result).isSimilarTo(getClass().getResource("search_global_permissions-example.json")); } @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchProjectPermissionsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchProjectPermissionsActionTest.java index 59f8498eb8a..6da5415d360 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchProjectPermissionsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchProjectPermissionsActionTest.java @@ -137,7 +137,7 @@ public class SearchProjectPermissionsActionTest { assertJson(result) .ignoreFields("permissions") - .isSimilarTo(getClass().getResource("SearchProjectPermissionsActionTest/search_project_permissions-example.json")); + .isSimilarTo(getClass().getResource("search_project_permissions-example.json")); } @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SearchTemplatesActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SearchTemplatesActionTest.java index d82444c85ce..a7e464a533f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SearchTemplatesActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SearchTemplatesActionTest.java @@ -137,7 +137,7 @@ public class SearchTemplatesActionTest { assertJson(result) .withStrictArrayOrder() .ignoreFields("permissions") - .isSimilarTo(getClass().getResource("SearchTemplatesActionTest/search_templates-example.json")); + .isSimilarTo(getClass().getResource("search_templates-example.json")); } @Test diff --git a/server/sonar-server/src/test/resources/org/sonar/server/permission/ws/SearchGlobalPermissionsActionTest/search_global_permissions-example.json b/server/sonar-server/src/test/resources/org/sonar/server/permission/ws/SearchGlobalPermissionsActionTest/search_global_permissions-example.json deleted file mode 100644 index 3a2a854cbf7..00000000000 --- a/server/sonar-server/src/test/resources/org/sonar/server/permission/ws/SearchGlobalPermissionsActionTest/search_global_permissions-example.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "permissions": [ - { - "key": "admin", - "name": "Administer System", - "description": "Ability to perform all administration functions for the instance: global configuration and personalization of default dashboards.", - "usersCount": 0, - "groupsCount": 1 - }, - { - "key": "profileadmin", - "name": "Administer Quality Profiles", - "description": "Ability to perform any action on the quality profiles.", - "usersCount": 2, - "groupsCount": 0 - }, - { - "key": "gateadmin", - "name": "Administer Quality Gates", - "description": "Ability to perform any action on the quality gates.", - "usersCount": 2, - "groupsCount": 0 - }, - { - "key": "shareDashboard", - "name": "Share Dashboards And Filters", - "description": "Ability to share dashboards, issue filters and measure filters.", - "usersCount": 0, - "groupsCount": 1 - }, - { - "key": "scan", - "name": "Execute Analysis", - "description": "Ability to execute analyses, and to get all settings required to perform the analysis, even the secured ones like the scm account password, the jira account password, and so on.", - "usersCount": 0, - "groupsCount": 2 - }, - { - "key": "dryRunScan", - "name": "Execute Preview Analysis", - "description": "Ability to execute preview analysis (results are not pushed to the server). This permission does not include the ability to access secured settings such as the scm account password, the jira account password, and so on. This permission is required to execute preview analysis in Eclipse or via the Issues Report plugin.", - "usersCount": 2, - "groupsCount": 0 - }, - { - "key": "provisioning", - "name": "Provision Projects", - "description": "Ability to initialize project structure before first analysis.", - "usersCount": 1, - "groupsCount": 1 - } - ] -} - - - diff --git a/server/sonar-server/src/test/resources/org/sonar/server/permission/ws/SearchProjectPermissionsActionTest/search_project_permissions-example.json b/server/sonar-server/src/test/resources/org/sonar/server/permission/ws/SearchProjectPermissionsActionTest/search_project_permissions-example.json deleted file mode 100644 index 43480d67f96..00000000000 --- a/server/sonar-server/src/test/resources/org/sonar/server/permission/ws/SearchProjectPermissionsActionTest/search_project_permissions-example.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "paging": { - "pageIndex": 1, - "pageSize": 25, - "total": 4 - }, - "projects": [ - { - "id": "0bd7b1e7-91d6-439e-a607-4a3a9aad3c6a", - "key": "net.java.openjdk:jdk7", - "name": "JDK 7", - "qualifier": "TRK", - "permissions": [ - { - "key": "admin", - "usersCount": 3, - "groupsCount": 4 - }, - { - "key": "issueadmin", - "usersCount": 1, - "groupsCount": 0 - } - ] - }, - { - "id": "ce4c03d6-430f-40a9-b777-ad877c00aa4d", - "key": "clang", - "name": "Clang", - "qualifier": "TRK", - "permissions": [ - { - "key": "issueadmin", - "usersCount": 1, - "groupsCount": 0 - } - ] - }, - { - "id": "4e607bf9-7ed0-484a-946d-d58ba7dab2fb", - "key": "simon-brandhof", - "name": "Simon Brandhof", - "qualifier": "DEV", - "permissions": [ - { - "key": "admin", - "usersCount": 0, - "groupsCount": 1 - }, - { - "key": "issueadmin", - "usersCount": 1, - "groupsCount": 0 - } - ] - }, - { - "id": "752d8bfd-420c-4a83-a4e5-8ab19b13c8fc", - "key": "Java", - "name": "Java", - "qualifier": "VW", - "permissions": [ - { - "key": "admin", - "usersCount": 0, - "groupsCount": 1 - }, - { - "key": "issueadmin", - "usersCount": 1, - "groupsCount": 0 - } - ] - } - ], - "permissions": [ - { - "key": "user", - "name": "Browse", - "description": "Ability to access a project, browse its measures, and create/edit issues for it." - }, - { - "key": "admin", - "name": "Administer", - "description": "Ability to access project settings and perform administration tasks. (Users will also need \"Browse\" permission)" - }, - { - "key": "issueadmin", - "name": "Administer Issues", - "description": "Grants the permission to perform advanced editing on issues: marking an issue False Positive / Won\u0027t Fix or changing an Issue\u0027s severity. (Users will also need \"Browse\" permission)" - }, - { - "key": "codeviewer", - "name": "See Source Code", - "description": "Ability to view the project\u0027s source code. (Users will also need \"Browse\" permission)" - } - ] -} diff --git a/server/sonar-server/src/test/resources/org/sonar/server/permission/ws/template/SearchTemplatesActionTest/search_templates-example.json b/server/sonar-server/src/test/resources/org/sonar/server/permission/ws/template/SearchTemplatesActionTest/search_templates-example.json deleted file mode 100644 index 75d69f5b497..00000000000 --- a/server/sonar-server/src/test/resources/org/sonar/server/permission/ws/template/SearchTemplatesActionTest/search_templates-example.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "permissionTemplates": [ - { - "id": "AU-TpxcA-iU5OvuD2FL0", - "name": "Default template for Developers", - "projectKeyPattern": ".*sonar.developer.*", - "createdAt": "2004-11-15T07:26:40+0100", - "updatedAt": "2004-11-19T22:33:20+0100", - "permissions": [ - { - "key": "user", - "usersCount": 0, - "groupsCount": 1 - } - ] - }, - { - "id": "AU-Tpxb--iU5OvuD2FLy", - "name": "Default template for Projects", - "description": "Template for new projects", - "createdAt": "2001-09-09T03:46:40+0200", - "updatedAt": "2001-09-09T03:46:40+0200", - "permissions": [ - { - "key": "admin", - "usersCount": 0, - "groupsCount": 1 - }, - { - "key": "codeviewer", - "usersCount": 1, - "groupsCount": 0 - }, - { - "key": "issueadmin", - "usersCount": 3, - "groupsCount": 0 - } - ] - }, - { - "id": "AU-TpxcA-iU5OvuD2FLz", - "name": "Default template for Views", - "description": "Template for new views", - "projectKeyPattern": ".*sonar.views.*", - "createdAt": "2001-09-09T03:46:40+0200", - "updatedAt": "2004-11-09T12:33:20+0100", - "permissions": [ - { - "key": "issueadmin", - "usersCount": 0, - "groupsCount": 3 - }, - { - "key": "user", - "usersCount": 2, - "groupsCount": 0 - } - ] - } - ], - "defaultTemplates": [ - { - "templateId": "AU-Tpxb--iU5OvuD2FLy", - "qualifier": "TRK" - }, - { - "templateId": "AU-TpxcA-iU5OvuD2FLz", - "qualifier": "VW" - }, - { - "templateId": "AU-TpxcA-iU5OvuD2FL0", - "qualifier": "DEV" - } - ] -}