]> source.dussan.org Git - sonarqube.git/commitdiff
Rename id and template id parameters in the permission domain 487/head
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Wed, 2 Sep 2015 14:52:19 +0000 (16:52 +0200)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Wed, 2 Sep 2015 14:52:19 +0000 (16:52 +0200)
17 files changed:
server/sonar-server/src/main/java/org/sonar/server/permission/ws/AddGroupToTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/AddUserToTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/ApplyTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/DeleteTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/Parameters.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/RemoveGroupFromTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/RemoveUserFromTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/SetDefaultTemplateAction.java
server/sonar-server/src/main/java/org/sonar/server/permission/ws/UpdateTemplateAction.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/AddGroupToTemplateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/AddUserToTemplateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/ApplyTemplateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/DeleteTemplateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveGroupFromTemplateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveUserFromTemplateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/SetDefaultTemplateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/permission/ws/UpdateTemplateActionTest.java

index 524b99f8787ca1cb3e2f54b5e0e04291598513de..5549e67cea78095a961694d3e21bad7afd57441e 100644 (file)
@@ -37,11 +37,11 @@ import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobal
 import static org.sonar.server.permission.ws.PermissionRequestValidator.validateNotAnyoneAndAdminPermission;
 import static org.sonar.server.permission.ws.PermissionRequestValidator.validateProjectPermission;
 import static org.sonar.server.permission.ws.Parameters.PARAM_PERMISSION;
-import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID_EXPLICIT;
+import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID;
 import static org.sonar.server.permission.ws.Parameters.createGroupIdParameter;
 import static org.sonar.server.permission.ws.Parameters.createGroupNameParameter;
 import static org.sonar.server.permission.ws.Parameters.createProjectPermissionParameter;
-import static org.sonar.server.permission.ws.Parameters.createExplicitTemplateId;
+import static org.sonar.server.permission.ws.Parameters.createTemplateIdParameter;
 
 public class AddGroupToTemplateAction implements PermissionsWsAction {
   private final DbClient dbClient;
@@ -65,7 +65,7 @@ public class AddGroupToTemplateAction implements PermissionsWsAction {
         "It requires administration permissions to access.")
       .setHandler(this);
 
-    createExplicitTemplateId(action);
+    createTemplateIdParameter(action);
     createProjectPermissionParameter(action);
     createGroupIdParameter(action);
     createGroupNameParameter(action);
@@ -75,7 +75,7 @@ public class AddGroupToTemplateAction implements PermissionsWsAction {
   public void handle(Request wsRequest, Response wsResponse) throws Exception {
     checkGlobalAdminUser(userSession);
 
-    String templateUuid = wsRequest.mandatoryParam(PARAM_TEMPLATE_ID_EXPLICIT);
+    String templateUuid = wsRequest.mandatoryParam(PARAM_TEMPLATE_ID);
     String permission = wsRequest.mandatoryParam(PARAM_PERMISSION);
     WsGroupRef group = WsGroupRef.fromRequest(wsRequest);
 
index 7e9656438e6db6cf200a7bc34b33d9ea8a303361..e5b534b97793830df883cc8a9a98120cb9924060 100644 (file)
@@ -38,10 +38,10 @@ import static org.sonar.db.user.GroupMembershipQuery.IN;
 import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdminUser;
 import static org.sonar.server.permission.ws.PermissionRequestValidator.validateProjectPermission;
 import static org.sonar.server.permission.ws.Parameters.PARAM_PERMISSION;
-import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID_EXPLICIT;
+import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID;
 import static org.sonar.server.permission.ws.Parameters.PARAM_USER_LOGIN;
 import static org.sonar.server.permission.ws.Parameters.createProjectPermissionParameter;
-import static org.sonar.server.permission.ws.Parameters.createExplicitTemplateId;
+import static org.sonar.server.permission.ws.Parameters.createTemplateIdParameter;
 import static org.sonar.server.permission.ws.Parameters.createUserLoginParameter;
 
 public class AddUserToTemplateAction implements PermissionsWsAction {
@@ -65,7 +65,7 @@ public class AddUserToTemplateAction implements PermissionsWsAction {
         "It requires administration permissions to access.")
       .setHandler(this);
 
-    createExplicitTemplateId(action);
+    createTemplateIdParameter(action);
     createProjectPermissionParameter(action);
     createUserLoginParameter(action);
   }
@@ -74,7 +74,7 @@ public class AddUserToTemplateAction implements PermissionsWsAction {
   public void handle(Request wsRequest, Response wsResponse) throws Exception {
     checkGlobalAdminUser(userSession);
 
-    String templateUuid = wsRequest.mandatoryParam(PARAM_TEMPLATE_ID_EXPLICIT);
+    String templateUuid = wsRequest.mandatoryParam(PARAM_TEMPLATE_ID);
     String permission = wsRequest.mandatoryParam(PARAM_PERMISSION);
     final String userLogin = wsRequest.mandatoryParam(PARAM_USER_LOGIN);
 
index ef3039d7f6113f161534943df4ecfe591856e9d6..88b79cfde1bae3e0fb98671cb68d1c1d72c4729d 100644 (file)
@@ -31,8 +31,8 @@ import org.sonar.server.permission.ApplyPermissionTemplateQuery;
 import org.sonar.server.permission.PermissionService;
 
 import static java.util.Collections.singletonList;
-import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID_EXPLICIT;
-import static org.sonar.server.permission.ws.Parameters.createExplicitTemplateId;
+import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID;
+import static org.sonar.server.permission.ws.Parameters.createTemplateIdParameter;
 import static org.sonar.server.permission.ws.Parameters.createProjectParameter;
 
 public class ApplyTemplateAction implements PermissionsWsAction {
@@ -56,13 +56,13 @@ public class ApplyTemplateAction implements PermissionsWsAction {
       .setSince("5.2")
       .setHandler(this);
 
-    createExplicitTemplateId(action);
+    createTemplateIdParameter(action);
     createProjectParameter(action);
   }
 
   @Override
   public void handle(Request wsRequest, Response wsResponse) throws Exception {
-    String templateUuid = wsRequest.mandatoryParam(PARAM_TEMPLATE_ID_EXPLICIT);
+    String templateUuid = wsRequest.mandatoryParam(PARAM_TEMPLATE_ID);
 
     DbSession dbSession = dbClient.openSession(false);
     try {
index bdafb42fdeb1b166cb1f6d805ad407193ea9c4bc..d0f467e0778339c8384fb9195cbc991d600510fb 100644 (file)
@@ -30,8 +30,8 @@ import org.sonar.db.permission.PermissionTemplateDto;
 import org.sonar.server.user.UserSession;
 
 import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdminUser;
-import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID;
-import static org.sonar.server.permission.ws.Parameters.createTemplateIdParameter;
+import static org.sonar.server.permission.ws.Parameters.PARAM_ID;
+import static org.sonar.server.permission.ws.Parameters.createIdParameter;
 import static org.sonar.server.ws.WsUtils.checkRequest;
 
 public class DeleteTemplateAction implements PermissionsWsAction {
@@ -56,14 +56,14 @@ public class DeleteTemplateAction implements PermissionsWsAction {
       .setPost(true)
       .setHandler(this);
 
-    createTemplateIdParameter(action);
+    createIdParameter(action);
   }
 
   @Override
   public void handle(Request wsRequest, Response wsResponse) throws Exception {
     checkGlobalAdminUser(userSession);
 
-    String uuid = wsRequest.mandatoryParam(PARAM_TEMPLATE_ID);
+    String uuid = wsRequest.mandatoryParam(PARAM_ID);
     checkTemplateUuidIsNotDefault(uuid);
 
     deleteTemplate(uuid);
index f2ecba4137c038b30d00752ec18f646671bf8208..3882689c6568b3525c054bea770ad14ce4c6a961 100644 (file)
@@ -34,9 +34,9 @@ class Parameters {
   static final String PARAM_PROJECT_ID = "projectId";
   static final String PARAM_PROJECT_KEY = "projectKey";
   static final String PARAM_USER_LOGIN = "login";
-  static final String PARAM_TEMPLATE_ID_EXPLICIT = "templateId";
+  static final String PARAM_TEMPLATE_ID = "templateId";
 
-  static final String PARAM_TEMPLATE_ID = "id";
+  static final String PARAM_ID = "id";
   static final String PARAM_TEMPLATE_NAME = "name";
   static final String PARAM_TEMPLATE_DESCRIPTION = "description";
   static final String PARAM_TEMPLATE_PATTERN = "projectKeyPattern";
@@ -108,8 +108,8 @@ class Parameters {
       .setExampleValue("g.hopper");
   }
 
-  static void createExplicitTemplateId(NewAction action) {
-    action.createParam(PARAM_TEMPLATE_ID_EXPLICIT)
+  static void createTemplateIdParameter(NewAction action) {
+    action.createParam(PARAM_TEMPLATE_ID)
       .setRequired(true)
       .setDescription("Template id")
       .setExampleValue("617f3501-3d32-41bd-a7ac-18315d2e3c7a");
@@ -127,10 +127,10 @@ class Parameters {
       .setExampleValue("Permissions for all projects related to the financial service");
   }
 
-  static void createTemplateIdParameter(NewAction action) {
-    action.createParam(PARAM_TEMPLATE_ID)
+  static void createIdParameter(NewAction action) {
+    action.createParam(PARAM_ID)
       .setRequired(true)
-      .setDescription("Key")
+      .setDescription("Id")
       .setExampleValue("af8cb8cc-1e78-4c4e-8c00-ee8e814009a5");
   }
 }
index 6a367fda991578cddb3a98d5bf275b3aeb4539c1..2da3fdbe987c7931b4c9f88cd183a9b8ad46fb1c 100644 (file)
@@ -32,11 +32,11 @@ import org.sonar.server.user.UserSession;
 import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdminUser;
 import static org.sonar.server.permission.ws.PermissionRequestValidator.validateProjectPermission;
 import static org.sonar.server.permission.ws.Parameters.PARAM_PERMISSION;
-import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID_EXPLICIT;
+import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID;
 import static org.sonar.server.permission.ws.Parameters.createGroupIdParameter;
 import static org.sonar.server.permission.ws.Parameters.createGroupNameParameter;
 import static org.sonar.server.permission.ws.Parameters.createProjectPermissionParameter;
-import static org.sonar.server.permission.ws.Parameters.createExplicitTemplateId;
+import static org.sonar.server.permission.ws.Parameters.createTemplateIdParameter;
 
 public class RemoveGroupFromTemplateAction implements PermissionsWsAction {
   private final DbClient dbClient;
@@ -60,7 +60,7 @@ public class RemoveGroupFromTemplateAction implements PermissionsWsAction {
         "It requires administration permissions to access.")
       .setHandler(this);
 
-    createExplicitTemplateId(action);
+    createTemplateIdParameter(action);
     createProjectPermissionParameter(action);
     createGroupIdParameter(action);
     createGroupNameParameter(action);
@@ -70,7 +70,7 @@ public class RemoveGroupFromTemplateAction implements PermissionsWsAction {
   public void handle(Request wsRequest, Response wsResponse) throws Exception {
     checkGlobalAdminUser(userSession);
 
-    String templateUuid = wsRequest.mandatoryParam(PARAM_TEMPLATE_ID_EXPLICIT);
+    String templateUuid = wsRequest.mandatoryParam(PARAM_TEMPLATE_ID);
     String permission = wsRequest.mandatoryParam(PARAM_PERMISSION);
     WsGroupRef group = WsGroupRef.fromRequest(wsRequest);
 
index 8eeb6269e5eb63c60dc5b56ccf6ae93a55918617..e65f3d2207178a72c38bf71f12848e990530a261 100644 (file)
@@ -32,10 +32,10 @@ import org.sonar.server.user.UserSession;
 import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdminUser;
 import static org.sonar.server.permission.ws.PermissionRequestValidator.validateProjectPermission;
 import static org.sonar.server.permission.ws.Parameters.PARAM_PERMISSION;
-import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID_EXPLICIT;
+import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID;
 import static org.sonar.server.permission.ws.Parameters.PARAM_USER_LOGIN;
 import static org.sonar.server.permission.ws.Parameters.createProjectPermissionParameter;
-import static org.sonar.server.permission.ws.Parameters.createExplicitTemplateId;
+import static org.sonar.server.permission.ws.Parameters.createTemplateIdParameter;
 import static org.sonar.server.permission.ws.Parameters.createUserLoginParameter;
 
 public class RemoveUserFromTemplateAction implements PermissionsWsAction {
@@ -59,7 +59,7 @@ public class RemoveUserFromTemplateAction implements PermissionsWsAction {
         "It requires administration permissions to access.")
       .setHandler(this);
 
-    createExplicitTemplateId(action);
+    createTemplateIdParameter(action);
     createProjectPermissionParameter(action);
     createUserLoginParameter(action);
   }
@@ -68,7 +68,7 @@ public class RemoveUserFromTemplateAction implements PermissionsWsAction {
   public void handle(Request wsRequest, Response wsResponse) throws Exception {
     checkGlobalAdminUser(userSession);
 
-    String templateUuid = wsRequest.mandatoryParam(PARAM_TEMPLATE_ID_EXPLICIT);
+    String templateUuid = wsRequest.mandatoryParam(PARAM_TEMPLATE_ID);
     String permission = wsRequest.mandatoryParam(PARAM_PERMISSION);
     String userLogin = wsRequest.mandatoryParam(PARAM_USER_LOGIN);
 
index ec13a4998bfa1988e0d06b0f255d47fac38b4630..95d659f119a14bbba042bad852ea630a6c439f38 100644 (file)
@@ -39,8 +39,8 @@ import static org.sonar.server.permission.DefaultPermissionTemplates.DEFAULT_TEM
 import static org.sonar.server.permission.DefaultPermissionTemplates.defaultRootQualifierTemplateProperty;
 import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdminUser;
 import static org.sonar.server.permission.ws.Parameters.PARAM_QUALIFIER;
-import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID_EXPLICIT;
-import static org.sonar.server.permission.ws.Parameters.createExplicitTemplateId;
+import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID;
+import static org.sonar.server.permission.ws.Parameters.createTemplateIdParameter;
 import static org.sonar.server.permission.ws.PermissionRequestValidator.validateQualifier;
 import static org.sonar.server.permission.ws.ResourceTypeToQualifier.RESOURCE_TYPE_TO_QUALIFIER;
 
@@ -71,7 +71,7 @@ public class SetDefaultTemplateAction implements PermissionsWsAction {
       .setSince("5.2")
       .setHandler(this);
 
-    createExplicitTemplateId(action);
+    createTemplateIdParameter(action);
 
     action.createParam(PARAM_QUALIFIER)
       .setDescription("Project qualifier. Possible values are:")
@@ -83,7 +83,7 @@ public class SetDefaultTemplateAction implements PermissionsWsAction {
   public void handle(Request wsRequest, Response wsResponse) throws Exception {
     checkGlobalAdminUser(userSession);
 
-    String templateUuid = wsRequest.mandatoryParam(PARAM_TEMPLATE_ID_EXPLICIT);
+    String templateUuid = wsRequest.mandatoryParam(PARAM_TEMPLATE_ID);
     String qualifier = wsRequest.mandatoryParam(PARAM_QUALIFIER);
 
     checkTemplateExists(templateUuid);
index aece6b2282563a4ad7e8bde13e9e5724c4a3f73a..a7d2ab6e1e5533cf9c60c22edfc0878cdb74ece7 100644 (file)
@@ -37,11 +37,11 @@ import static com.google.common.base.Objects.firstNonNull;
 import static java.lang.String.format;
 import static org.sonar.server.permission.PermissionPrivilegeChecker.checkGlobalAdminUser;
 import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_DESCRIPTION;
-import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID;
+import static org.sonar.server.permission.ws.Parameters.PARAM_ID;
 import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_NAME;
 import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_PATTERN;
 import static org.sonar.server.permission.ws.Parameters.createTemplateDescriptionParameter;
-import static org.sonar.server.permission.ws.Parameters.createTemplateIdParameter;
+import static org.sonar.server.permission.ws.Parameters.createIdParameter;
 import static org.sonar.server.permission.ws.Parameters.createTemplateProjectKeyPatternParameter;
 import static org.sonar.server.permission.ws.PermissionRequestValidator.MSG_TEMPLATE_WITH_SAME_NAME;
 import static org.sonar.server.permission.ws.PermissionRequestValidator.validateProjectPattern;
@@ -73,7 +73,7 @@ public class UpdateTemplateAction implements PermissionsWsAction {
       .setPost(true)
       .setHandler(this);
 
-    createTemplateIdParameter(action);
+    createIdParameter(action);
 
     action.createParam(PARAM_TEMPLATE_NAME)
       .setDescription("Name")
@@ -87,7 +87,7 @@ public class UpdateTemplateAction implements PermissionsWsAction {
   public void handle(Request wsRequest, Response wsResponse) throws Exception {
     checkGlobalAdminUser(userSession);
 
-    String key = wsRequest.mandatoryParam(PARAM_TEMPLATE_ID);
+    String key = wsRequest.mandatoryParam(PARAM_ID);
     String nameParam = wsRequest.param(PARAM_TEMPLATE_NAME);
     String descriptionParam = wsRequest.param(PARAM_TEMPLATE_DESCRIPTION);
     String projectPatternParam = wsRequest.param(PARAM_TEMPLATE_PATTERN);
index be155cbf5ccdb389cee7fe06c1080e08ed8992e0..8929be638229cc81b80da4174fb29fcdba0f1358 100644 (file)
@@ -59,7 +59,7 @@ import static org.sonar.db.permission.PermissionTemplateTesting.newPermissionTem
 import static org.sonar.db.user.GroupMembershipQuery.IN;
 import static org.sonar.db.user.GroupTesting.newGroupDto;
 import static org.sonar.server.permission.ws.Parameters.PARAM_GROUP_ID;
-import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID_EXPLICIT;
+import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID;
 import static org.sonar.server.permission.ws.Parameters.PARAM_PERMISSION;
 
 @Category(DbTests.class)
@@ -103,7 +103,7 @@ public class AddGroupToTemplateActionTest {
   @Test
   public void add_with_group_id() {
     ws.newRequest()
-      .setParam(PARAM_TEMPLATE_ID_EXPLICIT, permissionTemplate.getKee())
+      .setParam(PARAM_TEMPLATE_ID, permissionTemplate.getKee())
       .setParam(PARAM_PERMISSION, CODEVIEWER)
       .setParam(PARAM_GROUP_ID, String.valueOf(group.getId()))
       .execute();
@@ -200,7 +200,7 @@ public class AddGroupToTemplateActionTest {
       request.setParam(Parameters.PARAM_GROUP_NAME, groupName);
     }
     if (templateKey != null) {
-      request.setParam(PARAM_TEMPLATE_ID_EXPLICIT, templateKey);
+      request.setParam(PARAM_TEMPLATE_ID, templateKey);
     }
     if (permission != null) {
       request.setParam(Parameters.PARAM_PERMISSION, permission);
index ee2cfdd764e28544aa31b22f57d289e1aa805b85..89f911683f9619fb9416a7c9d65cc86b4926d0b7 100644 (file)
@@ -168,7 +168,7 @@ public class AddUserToTemplateActionTest {
       request.setParam(Parameters.PARAM_USER_LOGIN, userLogin);
     }
     if (templateKey != null) {
-      request.setParam(Parameters.PARAM_TEMPLATE_ID_EXPLICIT, templateKey);
+      request.setParam(Parameters.PARAM_TEMPLATE_ID, templateKey);
     }
     if (permission != null) {
       request.setParam(Parameters.PARAM_PERMISSION, permission);
index 33770ed5b720e3a60750ef09861bd59d419c0d32..3e10bc2630d674183c375854f29e2d373b9a4d52 100644 (file)
@@ -70,7 +70,7 @@ import static org.sonar.db.user.GroupTesting.newGroupDto;
 import static org.sonar.db.user.UserTesting.newUserDto;
 import static org.sonar.server.permission.ws.Parameters.PARAM_PROJECT_ID;
 import static org.sonar.server.permission.ws.Parameters.PARAM_PROJECT_KEY;
-import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID_EXPLICIT;
+import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID;
 
 @Category(DbTests.class)
 public class ApplyTemplateActionTest {
@@ -221,7 +221,7 @@ public class ApplyTemplateActionTest {
   private TestResponse newRequest(@Nullable String templateUuid, @Nullable String projectUuid, @Nullable String projectKey) {
     TestRequest request = ws.newRequest();
     if (templateUuid != null) {
-      request.setParam(PARAM_TEMPLATE_ID_EXPLICIT, templateUuid);
+      request.setParam(PARAM_TEMPLATE_ID, templateUuid);
     }
     if (projectUuid != null) {
       request.setParam(PARAM_PROJECT_ID, projectUuid);
index 319a7e1fa2237d983be5abe8eb160248e6fe535f..7a5fca2395d49a36979ff0df7dd0c47e977f80d1 100644 (file)
@@ -52,7 +52,7 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 import static org.mockito.internal.util.collections.Sets.newSet;
 import static org.sonar.db.permission.PermissionTemplateTesting.newPermissionTemplateDto;
-import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID;
+import static org.sonar.server.permission.ws.Parameters.PARAM_ID;
 
 public class DeleteTemplateActionTest {
 
@@ -155,7 +155,7 @@ public class DeleteTemplateActionTest {
   private TestResponse newRequest(@Nullable String id) {
     TestRequest request = ws.newRequest();
     if (id != null) {
-      request.setParam(PARAM_TEMPLATE_ID, id);
+      request.setParam(PARAM_ID, id);
     }
 
     TestResponse result = executeRequest(request);
index 7b880d69a8f7601d6138207c3b9c9dd112d79232..8a335a9d291c2a1f396b4f0bacb0c0c11993fa03 100644 (file)
@@ -57,7 +57,7 @@ import static org.sonar.db.user.GroupMembershipQuery.IN;
 import static org.sonar.db.user.GroupTesting.newGroupDto;
 import static org.sonar.server.permission.ws.Parameters.PARAM_GROUP_ID;
 import static org.sonar.server.permission.ws.Parameters.PARAM_PERMISSION;
-import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID_EXPLICIT;
+import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID;
 
 @Category(DbTests.class)
 public class RemoveGroupFromTemplateActionTest {
@@ -108,7 +108,7 @@ public class RemoveGroupFromTemplateActionTest {
     commit();
 
     ws.newRequest()
-      .setParam(PARAM_TEMPLATE_ID_EXPLICIT, permissionTemplate.getKee())
+      .setParam(PARAM_TEMPLATE_ID, permissionTemplate.getKee())
       .setParam(PARAM_PERMISSION, PERMISSION)
       .setParam(PARAM_GROUP_ID, String.valueOf(group.getId()))
       .execute();
@@ -200,7 +200,7 @@ public class RemoveGroupFromTemplateActionTest {
       request.setParam(Parameters.PARAM_GROUP_NAME, groupName);
     }
     if (templateKey != null) {
-      request.setParam(PARAM_TEMPLATE_ID_EXPLICIT, templateKey);
+      request.setParam(PARAM_TEMPLATE_ID, templateKey);
     }
     if (permission != null) {
       request.setParam(Parameters.PARAM_PERMISSION, permission);
index 1b7187e335e90d9409b7eb3ff53e43b32d74a2ea..aa4708556237ac06935eed3d22441bd429f83980 100644 (file)
@@ -192,7 +192,7 @@ public class RemoveUserFromTemplateActionTest {
       request.setParam(Parameters.PARAM_USER_LOGIN, userLogin);
     }
     if (templateKey != null) {
-      request.setParam(Parameters.PARAM_TEMPLATE_ID_EXPLICIT, templateKey);
+      request.setParam(Parameters.PARAM_TEMPLATE_ID, templateKey);
     }
     if (permission != null) {
       request.setParam(Parameters.PARAM_PERMISSION, permission);
index 88b04752a4df052846a47e95f4d5a14daeea859e..a6d3274ebd1109f43091b6775b6fea0cf5a4a83c 100644 (file)
@@ -61,7 +61,7 @@ import static org.sonar.api.resources.Qualifiers.VIEW;
 import static org.sonar.server.permission.DefaultPermissionTemplates.DEFAULT_TEMPLATE_PROPERTY;
 import static org.sonar.server.permission.DefaultPermissionTemplates.defaultRootQualifierTemplateProperty;
 import static org.sonar.server.permission.ws.Parameters.PARAM_QUALIFIER;
-import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID_EXPLICIT;
+import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID;
 
 @Category(DbTests.class)
 public class SetDefaultTemplateActionTest {
@@ -163,7 +163,7 @@ public class SetDefaultTemplateActionTest {
   private String newRequest(@Nullable String templateUuid, @Nullable String qualifier) {
     TestRequest request = ws.newRequest();
     if (templateUuid != null) {
-      request.setParam(PARAM_TEMPLATE_ID_EXPLICIT, templateUuid);
+      request.setParam(PARAM_TEMPLATE_ID, templateUuid);
     }
     if (qualifier != null) {
       request.setParam(PARAM_QUALIFIER, qualifier);
index cb467bcd7a16b1401d8badd8dc81515db0e7d1d4..4f12bd9116b1c76b2ad24a9a89f65cd5c6fdf3a8 100644 (file)
@@ -48,7 +48,7 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 import static org.sonar.db.permission.PermissionTemplateTesting.newPermissionTemplateDto;
 import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_DESCRIPTION;
-import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_ID;
+import static org.sonar.server.permission.ws.Parameters.PARAM_ID;
 import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_NAME;
 import static org.sonar.server.permission.ws.Parameters.PARAM_TEMPLATE_PATTERN;
 import static org.sonar.test.JsonAssert.assertJson;
@@ -220,7 +220,7 @@ public class UpdateTemplateActionTest {
   private TestResponse newRequest(@Nullable String key, @Nullable String name, @Nullable String description, @Nullable String projectPattern) {
     TestRequest request = ws.newRequest();
     if (key != null) {
-      request.setParam(PARAM_TEMPLATE_ID, key);
+      request.setParam(PARAM_ID, key);
     }
     if (name != null) {
       request.setParam(PARAM_TEMPLATE_NAME, name);