]> source.dussan.org Git - sonarqube.git/commitdiff
Move WS responses at the right place
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 15 Jan 2016 16:56:43 +0000 (17:56 +0100)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 15 Jan 2016 17:05:43 +0000 (18:05 +0100)
server/sonar-server/src/main/resources/org/sonar/server/permission/ws/search_global_permissions-example.json [new file with mode: 0644]
server/sonar-server/src/main/resources/org/sonar/server/permission/ws/search_project_permissions-example.json [new file with mode: 0644]
server/sonar-server/src/main/resources/org/sonar/server/permission/ws/template/search_templates-example.json [new file with mode: 0644]
server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchGlobalPermissionsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchProjectPermissionsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SearchTemplatesActionTest.java
server/sonar-server/src/test/resources/org/sonar/server/permission/ws/SearchGlobalPermissionsActionTest/search_global_permissions-example.json [deleted file]
server/sonar-server/src/test/resources/org/sonar/server/permission/ws/SearchProjectPermissionsActionTest/search_project_permissions-example.json [deleted file]
server/sonar-server/src/test/resources/org/sonar/server/permission/ws/template/SearchTemplatesActionTest/search_templates-example.json [deleted file]

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 (file)
index 0000000..3a2a854
--- /dev/null
@@ -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 (file)
index 0000000..43480d6
--- /dev/null
@@ -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 (file)
index 0000000..75d69f5
--- /dev/null
@@ -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"
+    }
+  ]
+}
index 2102f5b9fcf7d518686fee64bce87bcc8c760204..6f74c51cc388412803f5851c3f26ec8833c00e31 100644 (file)
@@ -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
index 59f8498eb8a2eac5a485a7060471c88b1f8288c9..6da5415d360246f76daf7ad91143dd9d27502afe 100644 (file)
@@ -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
index d82444c85ce0aba098d3bdf980032b7694dd966a..a7e464a533f79d3926bb5a21c21d550ff3853e46 100644 (file)
@@ -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 (file)
index 3a2a854..0000000
+++ /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 (file)
index 43480d6..0000000
+++ /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 (file)
index 75d69f5..0000000
+++ /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"
-    }
-  ]
-}