diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-07-18 15:44:48 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-07-22 00:31:16 +0200 |
commit | 6182f01a60369b10bd0f5a2e065d7f844496da5b (patch) | |
tree | 64f47830483b147ef9ecadb8ea8c723a9ced283a /sonar-ws | |
parent | b18e284c549f4e46d0ad806cfbcc76e348027bd7 (diff) | |
download | sonarqube-6182f01a60369b10bd0f5a2e065d7f844496da5b.tar.gz sonarqube-6182f01a60369b10bd0f5a2e065d7f844496da5b.zip |
SONAR-9516 add integration tests on permission templates WS
including ES resiliency tests
Diffstat (limited to 'sonar-ws')
7 files changed, 95 insertions, 24 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupWsRequest.java index c11e26c4887..99233d65875 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupWsRequest.java @@ -27,7 +27,7 @@ import static java.util.Objects.requireNonNull; public class AddGroupWsRequest { private String permission; private String groupId; - private String organizationKey; + private String organization; private String groupName; private String projectId; private String projectKey; @@ -52,12 +52,12 @@ public class AddGroupWsRequest { } @CheckForNull - public String getOrganizationKey() { - return organizationKey; + public String getOrganization() { + return organization; } - public AddGroupWsRequest setOrganizationKey(@Nullable String s) { - this.organizationKey = s; + public AddGroupWsRequest setOrganization(@Nullable String s) { + this.organization = s; return this; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/CreateTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/CreateTemplateWsRequest.java index fa0a8c134f5..65f9d3a6eb4 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/CreateTemplateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/CreateTemplateWsRequest.java @@ -28,7 +28,7 @@ public class CreateTemplateWsRequest { private String description; private String name; private String projectKeyPattern; - private String organizationKey; + private String organization; @CheckForNull public String getDescription() { @@ -60,12 +60,12 @@ public class CreateTemplateWsRequest { } @CheckForNull - public String getOrganizationKey() { - return organizationKey; + public String getOrganization() { + return organization; } - public CreateTemplateWsRequest setOrganizationKey(@Nullable String s) { - this.organizationKey = s; + public CreateTemplateWsRequest setOrganization(@Nullable String s) { + this.organization = s; return this; } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/PermissionsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/PermissionsService.java index f0ba7f80bd9..81cccb39e9f 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/PermissionsService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/PermissionsService.java @@ -65,6 +65,7 @@ public class PermissionsService extends BaseService { public void addGroup(AddGroupWsRequest request) { call(new PostRequest(path("add_group")) + .setParam(PARAM_ORGANIZATION, request.getOrganization()) .setParam(PARAM_PERMISSION, request.getPermission()) .setParam(PARAM_PROJECT_ID, request.getProjectId()) .setParam(PARAM_PROJECT_KEY, request.getProjectKey()) @@ -92,6 +93,7 @@ public class PermissionsService extends BaseService { public void addUserToTemplate(AddUserToTemplateWsRequest request) { call(new PostRequest(path("add_user_to_template")) + .setParam(PARAM_ORGANIZATION, request.getOrganization()) .setParam(PARAM_PERMISSION, request.getPermission()) .setParam(PARAM_USER_LOGIN, request.getLogin()) .setParam(PARAM_TEMPLATE_ID, request.getTemplateId()) @@ -100,6 +102,7 @@ public class PermissionsService extends BaseService { public void addProjectCreatorToTemplate(AddProjectCreatorToTemplateWsRequest request) { call(new PostRequest(path("add_project_creator_to_template")) + .setParam(PARAM_ORGANIZATION, request.getOrganization()) .setParam(PARAM_PERMISSION, request.getPermission()) .setParam(PARAM_TEMPLATE_ID, request.getTemplateId()) .setParam(PARAM_TEMPLATE_NAME, request.getTemplateName())); @@ -107,6 +110,7 @@ public class PermissionsService extends BaseService { public void applyTemplate(ApplyTemplateWsRequest request) { call(new PostRequest(path("apply_template")) + .setParam(PARAM_ORGANIZATION, request.getOrganization()) .setParam(PARAM_PROJECT_ID, request.getProjectId()) .setParam(PARAM_PROJECT_KEY, request.getProjectKey()) .setParam(PARAM_TEMPLATE_ID, request.getTemplateId()) @@ -115,6 +119,7 @@ public class PermissionsService extends BaseService { public void bulkApplyTemplate(BulkApplyTemplateWsRequest request) { call(new PostRequest(path("bulk_apply_template")) + .setParam(PARAM_ORGANIZATION, request.getOrganization()) .setParam(PARAM_TEMPLATE_ID, request.getTemplateId()) .setParam(PARAM_TEMPLATE_NAME, request.getTemplateName()) .setParam("q", request.getQuery()) @@ -123,6 +128,7 @@ public class PermissionsService extends BaseService { public CreateTemplateWsResponse createTemplate(CreateTemplateWsRequest request) { PostRequest post = new PostRequest(path("create_template")) + .setParam(PARAM_ORGANIZATION, request.getOrganization()) .setParam(PARAM_NAME, request.getName()) .setParam(PARAM_DESCRIPTION, request.getDescription()) .setParam(PARAM_PROJECT_KEY_PATTERN, request.getProjectKeyPattern()); @@ -131,12 +137,14 @@ public class PermissionsService extends BaseService { public void deleteTemplate(DeleteTemplateWsRequest request) { call(new PostRequest(path("delete_template")) + .setParam(PARAM_ORGANIZATION, request.getOrganization()) .setParam(PARAM_TEMPLATE_ID, request.getTemplateId()) .setParam(PARAM_TEMPLATE_NAME, request.getTemplateName())); } public void removeGroup(RemoveGroupWsRequest request) { call(new PostRequest(path("remove_group")) + .setParam(PARAM_ORGANIZATION, request.getOrganization()) .setParam(PARAM_PERMISSION, request.getPermission()) .setParam(PARAM_GROUP_ID, request.getGroupId()) .setParam(PARAM_GROUP_NAME, request.getGroupName()) @@ -146,6 +154,7 @@ public class PermissionsService extends BaseService { public void removeGroupFromTemplate(RemoveGroupFromTemplateWsRequest request) { call(new PostRequest(path("remove_group_from_template")) + .setParam(PARAM_ORGANIZATION, request.getOrganization()) .setParam(PARAM_PERMISSION, request.getPermission()) .setParam(PARAM_GROUP_ID, request.getGroupId()) .setParam(PARAM_GROUP_NAME, request.getGroupName()) @@ -156,6 +165,7 @@ public class PermissionsService extends BaseService { public void removeProjectCreatorFromTemplate(RemoveProjectCreatorFromTemplateWsRequest request) { call( new PostRequest(path("remove_project_creator_from_template")) + .setParam(PARAM_ORGANIZATION, request.getOrganization()) .setParam(PARAM_PERMISSION, request.getPermission()) .setParam(PARAM_TEMPLATE_ID, request.getTemplateId()) .setParam(PARAM_TEMPLATE_NAME, request.getTemplateName())); @@ -171,6 +181,7 @@ public class PermissionsService extends BaseService { public void removeUserFromTemplate(RemoveUserFromTemplateWsRequest request) { call(new PostRequest(path("remove_user_from_template")) + .setParam(PARAM_ORGANIZATION, request.getOrganization()) .setParam(PARAM_PERMISSION, request.getPermission()) .setParam(PARAM_USER_LOGIN, request.getLogin()) .setParam(PARAM_TEMPLATE_ID, request.getTemplateId()) @@ -216,6 +227,7 @@ public class PermissionsService extends BaseService { public UsersWsResponse users(UsersWsRequest request) { return call(new GetRequest(path("users")) + .setParam(PARAM_ORGANIZATION, request.getOrganization()) .setParam(PARAM_PERMISSION, request.getPermission()) .setParam(PARAM_PROJECT_ID, request.getProjectId()) .setParam(PARAM_PROJECT_KEY, request.getProjectKey()) diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupFromTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupFromTemplateWsRequest.java index 813e3bf188e..91e4815106c 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupFromTemplateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupFromTemplateWsRequest.java @@ -25,6 +25,7 @@ import javax.annotation.Nullable; import static java.util.Objects.requireNonNull; public class RemoveGroupFromTemplateWsRequest { + private String organization; private String permission; private String groupId; private String groupName; @@ -41,6 +42,16 @@ public class RemoveGroupFromTemplateWsRequest { } @CheckForNull + public String getOrganization() { + return organization; + } + + public RemoveGroupFromTemplateWsRequest setOrganization(@Nullable String s) { + this.organization = s; + return this; + } + + @CheckForNull public String getGroupId() { return groupId; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupWsRequest.java index 9be548dc077..0a7930a6ef0 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/RemoveGroupWsRequest.java @@ -23,6 +23,7 @@ import javax.annotation.CheckForNull; import javax.annotation.Nullable; public class RemoveGroupWsRequest { + private String organization; private String groupId; private String groupName; private String permission; @@ -30,6 +31,16 @@ public class RemoveGroupWsRequest { private String projectKey; @CheckForNull + public String getOrganization() { + return organization; + } + + public RemoveGroupWsRequest setOrganization(@Nullable String s) { + this.organization = s; + return this; + } + + @CheckForNull public String getGroupId() { return groupId; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UsersWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UsersWsRequest.java index d9b53b71f91..930178e1293 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UsersWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/UsersWsRequest.java @@ -23,6 +23,7 @@ import javax.annotation.CheckForNull; import javax.annotation.Nullable; public class UsersWsRequest { + private String organization; private String permission; private String projectId; private String projectKey; @@ -31,6 +32,16 @@ public class UsersWsRequest { private Integer pageSize; @CheckForNull + public String getOrganization() { + return organization; + } + + public UsersWsRequest setOrganization(@Nullable String s) { + this.organization = s; + return this; + } + + @CheckForNull public String getPermission() { return permission; } diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/permission/PermissionsServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/permission/PermissionsServiceTest.java index 59284879cc6..cbde5d0003d 100644 --- a/sonar-ws/src/test/java/org/sonarqube/ws/client/permission/PermissionsServiceTest.java +++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/permission/PermissionsServiceTest.java @@ -34,6 +34,7 @@ import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_G import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_GROUP_NAME; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ID; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_NAME; +import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_ORGANIZATION; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY; @@ -44,6 +45,7 @@ import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_T import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_USER_LOGIN; public class PermissionsServiceTest { + private static final String ORGANIZATION_VALUE = "organization value"; private static final String PERMISSION_VALUE = "permission value"; private static final String PROJECT_ID_VALUE = "project id value"; private static final String PROJECT_KEY_VALUE = "project key value"; @@ -100,6 +102,7 @@ public class PermissionsServiceTest { @Test public void addGroup_does_POST_on_Ws_add_group() { underTest.addGroup(new AddGroupWsRequest() + .setOrganization(ORGANIZATION_VALUE) .setPermission(PERMISSION_VALUE) .setProjectId(PROJECT_ID_VALUE) .setProjectKey(PROJECT_KEY_VALUE) @@ -110,6 +113,7 @@ public class PermissionsServiceTest { PostRequest postRequest = serviceTester.getPostRequest(); serviceTester.assertThat(postRequest) .hasPath("add_group") + .hasParam(PARAM_ORGANIZATION, ORGANIZATION_VALUE) .hasParam(PARAM_PERMISSION, PERMISSION_VALUE) .hasParam(PARAM_PROJECT_ID, PROJECT_ID_VALUE) .hasParam(PARAM_PROJECT_KEY, PROJECT_KEY_VALUE) @@ -127,7 +131,7 @@ public class PermissionsServiceTest { .setPermission(PERMISSION_VALUE) .setTemplateId(TEMPLATE_ID_VALUE) .setTemplateName(TEMPLATE_NAME_VALUE) - ); + ); assertThat(serviceTester.getPostParser()).isNull(); PostRequest postRequest = serviceTester.getPostRequest(); @@ -145,16 +149,18 @@ public class PermissionsServiceTest { public void addUser_does_POST_on_Ws_add_user() { underTest.addUser(new AddUserWsRequest() .setLogin(LOGIN_VALUE) + .setOrganization(ORGANIZATION_VALUE) .setPermission(PERMISSION_VALUE) .setProjectId(PROJECT_ID_VALUE) .setProjectKey(PROJECT_KEY_VALUE) - ); + ); assertThat(serviceTester.getPostParser()).isNull(); PostRequest postRequest = serviceTester.getPostRequest(); serviceTester.assertThat(postRequest) .hasPath("add_user") .hasParam(PARAM_USER_LOGIN, LOGIN_VALUE) + .hasParam(PARAM_ORGANIZATION, ORGANIZATION_VALUE) .hasParam(PARAM_PERMISSION, PERMISSION_VALUE) .hasParam(PARAM_PROJECT_ID, PROJECT_ID_VALUE) .hasParam(PARAM_PROJECT_KEY, PROJECT_KEY_VALUE) @@ -164,16 +170,18 @@ public class PermissionsServiceTest { @Test public void addUserToTemplate_does_POST_on_Ws_add_user_to_template() { underTest.addUserToTemplate(new AddUserToTemplateWsRequest() + .setOrganization(ORGANIZATION_VALUE) .setPermission(PERMISSION_VALUE) .setLogin(LOGIN_VALUE) .setTemplateId(TEMPLATE_ID_VALUE) .setTemplateName(TEMPLATE_NAME_VALUE) - ); + ); assertThat(serviceTester.getPostParser()).isNull(); PostRequest postRequest = serviceTester.getPostRequest(); serviceTester.assertThat(postRequest) .hasPath("add_user_to_template") + .hasParam(PARAM_ORGANIZATION, ORGANIZATION_VALUE) .hasParam(PARAM_PERMISSION, PERMISSION_VALUE) .hasParam(PARAM_USER_LOGIN, LOGIN_VALUE) .hasParam(PARAM_TEMPLATE_ID, TEMPLATE_ID_VALUE) @@ -184,16 +192,18 @@ public class PermissionsServiceTest { @Test public void applyTemplate_does_POST_on_Ws_apply_template() { underTest.applyTemplate(new ApplyTemplateWsRequest() + .setOrganization(ORGANIZATION_VALUE) .setProjectId(PROJECT_ID_VALUE) .setProjectKey(PROJECT_KEY_VALUE) .setTemplateId(TEMPLATE_ID_VALUE) .setTemplateName(TEMPLATE_NAME_VALUE) - ); + ); assertThat(serviceTester.getPostParser()).isNull(); PostRequest postRequest = serviceTester.getPostRequest(); serviceTester.assertThat(postRequest) .hasPath("apply_template") + .hasParam(PARAM_ORGANIZATION, ORGANIZATION_VALUE) .hasParam(PARAM_PROJECT_ID, PROJECT_ID_VALUE) .hasParam(PARAM_PROJECT_KEY, PROJECT_KEY_VALUE) .hasParam(PARAM_TEMPLATE_ID, TEMPLATE_ID_VALUE) @@ -204,6 +214,7 @@ public class PermissionsServiceTest { @Test public void bulk_apply_template() { underTest.bulkApplyTemplate(new BulkApplyTemplateWsRequest() + .setOrganization(ORGANIZATION_VALUE) .setTemplateId(TEMPLATE_ID_VALUE) .setTemplateName(TEMPLATE_NAME_VALUE) .setQualifier(QUALIFIER_VALUE) @@ -213,6 +224,7 @@ public class PermissionsServiceTest { PostRequest postRequest = serviceTester.getPostRequest(); serviceTester.assertThat(postRequest) .hasPath("bulk_apply_template") + .hasParam(PARAM_ORGANIZATION, ORGANIZATION_VALUE) .hasParam(PARAM_TEMPLATE_ID, TEMPLATE_ID_VALUE) .hasParam(PARAM_TEMPLATE_NAME, TEMPLATE_NAME_VALUE) .hasParam("q", QUERY_VALUE) @@ -223,15 +235,17 @@ public class PermissionsServiceTest { @Test public void createTemplate_does_POST_on_Ws_create_template() { underTest.createTemplate(new CreateTemplateWsRequest() + .setOrganization(ORGANIZATION_VALUE) .setName(NAME_VALUE) .setDescription(DESCRIPTION_VALUE) .setProjectKeyPattern(PROJECT_KEY_PATTERN_VALUE) - ); + ); assertThat(serviceTester.getPostParser()).isSameAs(WsPermissions.CreateTemplateWsResponse.parser()); PostRequest postRequest = serviceTester.getPostRequest(); serviceTester.assertThat(postRequest) .hasPath("create_template") + .hasParam(PARAM_ORGANIZATION, ORGANIZATION_VALUE) .hasParam(PARAM_NAME, NAME_VALUE) .hasParam(PARAM_DESCRIPTION, DESCRIPTION_VALUE) .hasParam(PARAM_PROJECT_KEY_PATTERN, PROJECT_KEY_PATTERN_VALUE) @@ -243,7 +257,8 @@ public class PermissionsServiceTest { underTest.deleteTemplate(new DeleteTemplateWsRequest() .setTemplateId(TEMPLATE_ID_VALUE) .setTemplateName(TEMPLATE_NAME_VALUE) - ); + .setOrganization(ORGANIZATION_VALUE) + ); assertThat(serviceTester.getPostParser()).isNull(); PostRequest postRequest = serviceTester.getPostRequest(); @@ -251,6 +266,7 @@ public class PermissionsServiceTest { .hasPath("delete_template") .hasParam(PARAM_TEMPLATE_ID, TEMPLATE_ID_VALUE) .hasParam(PARAM_TEMPLATE_NAME, TEMPLATE_NAME_VALUE) + .hasParam(PARAM_ORGANIZATION, ORGANIZATION_VALUE) .andNoOtherParam(); } @@ -262,7 +278,8 @@ public class PermissionsServiceTest { .setGroupName(GROUP_NAME_VALUE) .setProjectId(PROJECT_ID_VALUE) .setProjectKey(PROJECT_KEY_VALUE) - ); + .setOrganization(ORGANIZATION_VALUE) + ); assertThat(serviceTester.getPostParser()).isNull(); PostRequest postRequest = serviceTester.getPostRequest(); @@ -273,6 +290,7 @@ public class PermissionsServiceTest { .hasParam(PARAM_GROUP_NAME, GROUP_NAME_VALUE) .hasParam(PARAM_PROJECT_ID, PROJECT_ID_VALUE) .hasParam(PARAM_PROJECT_KEY, PROJECT_KEY_VALUE) + .hasParam(PARAM_ORGANIZATION, ORGANIZATION_VALUE) .andNoOtherParam(); } @@ -284,7 +302,8 @@ public class PermissionsServiceTest { .setGroupName(GROUP_NAME_VALUE) .setTemplateId(TEMPLATE_ID_VALUE) .setTemplateName(TEMPLATE_NAME_VALUE) - ); + .setOrganization(ORGANIZATION_VALUE) + ); assertThat(serviceTester.getPostParser()).isNull(); PostRequest postRequest = serviceTester.getPostRequest(); @@ -295,6 +314,7 @@ public class PermissionsServiceTest { .hasParam(PARAM_GROUP_NAME, GROUP_NAME_VALUE) .hasParam(PARAM_TEMPLATE_ID, TEMPLATE_ID_VALUE) .hasParam(PARAM_TEMPLATE_NAME, TEMPLATE_NAME_VALUE) + .hasParam(PARAM_ORGANIZATION, ORGANIZATION_VALUE) .andNoOtherParam(); } @@ -305,7 +325,7 @@ public class PermissionsServiceTest { .setLogin(LOGIN_VALUE) .setProjectId(PROJECT_ID_VALUE) .setProjectKey(PROJECT_KEY_VALUE) - ); + ); assertThat(serviceTester.getPostParser()).isNull(); PostRequest postRequest = serviceTester.getPostRequest(); @@ -325,7 +345,8 @@ public class PermissionsServiceTest { .setLogin(LOGIN_VALUE) .setTemplateId(TEMPLATE_ID_VALUE) .setTemplateName(TEMPLATE_NAME_VALUE) - ); + .setOrganization(ORGANIZATION_VALUE) + ); assertThat(serviceTester.getPostParser()).isNull(); PostRequest postRequest = serviceTester.getPostRequest(); @@ -335,6 +356,7 @@ public class PermissionsServiceTest { .hasParam(PARAM_USER_LOGIN, LOGIN_VALUE) .hasParam(PARAM_TEMPLATE_ID, TEMPLATE_ID_VALUE) .hasParam(PARAM_TEMPLATE_NAME, TEMPLATE_NAME_VALUE) + .hasParam(PARAM_ORGANIZATION, ORGANIZATION_VALUE) .andNoOtherParam(); } @@ -358,7 +380,7 @@ public class PermissionsServiceTest { .setPage(PAGE_VALUE) .setPageSize(PAGE_SIZE_VALUE) .setQuery(QUERY_VALUE) - ); + ); assertThat(serviceTester.getGetParser()).isSameAs(WsPermissions.SearchProjectPermissionsWsResponse.parser()); GetRequest getRequest = serviceTester.getGetRequest(); @@ -377,7 +399,7 @@ public class PermissionsServiceTest { public void searchTemplates_does_GET_on_Ws_search_templates() { underTest.searchTemplates(new SearchTemplatesWsRequest() .setQuery(QUERY_VALUE) - ); + ); assertThat(serviceTester.getGetParser()).isSameAs(WsPermissions.SearchTemplatesWsResponse.parser()); GetRequest getRequest = serviceTester.getGetRequest(); @@ -393,7 +415,7 @@ public class PermissionsServiceTest { .setQualifier(QUALIFIER_VALUE) .setTemplateId(TEMPLATE_ID_VALUE) .setTemplateName(TEMPLATE_NAME_VALUE) - ); + ); assertThat(serviceTester.getPostParser()).isNull(); PostRequest postRequest = serviceTester.getPostRequest(); @@ -412,7 +434,7 @@ public class PermissionsServiceTest { .setId(TEMPLATE_ID_VALUE) .setName(TEMPLATE_NAME_VALUE) .setProjectKeyPattern(PROJECT_KEY_PATTERN_VALUE) - ); + ); assertThat(serviceTester.getPostParser()).isSameAs(WsPermissions.UpdateTemplateWsResponse.parser()); PostRequest postRequest = serviceTester.getPostRequest(); @@ -431,6 +453,7 @@ public class PermissionsServiceTest { .setPermission(PERMISSION_VALUE) .setTemplateId(TEMPLATE_ID_VALUE) .setTemplateName(TEMPLATE_NAME_VALUE) + .setOrganization(ORGANIZATION_VALUE) .build()); assertThat(serviceTester.getPostParser()).isNull(); @@ -440,6 +463,7 @@ public class PermissionsServiceTest { .hasParam(PARAM_PERMISSION, PERMISSION_VALUE) .hasParam(PARAM_TEMPLATE_ID, TEMPLATE_ID_VALUE) .hasParam(PARAM_TEMPLATE_NAME, TEMPLATE_NAME_VALUE) + .hasParam(PARAM_ORGANIZATION, ORGANIZATION_VALUE) .andNoOtherParam(); } @@ -449,6 +473,7 @@ public class PermissionsServiceTest { .setPermission(PERMISSION_VALUE) .setTemplateId(TEMPLATE_ID_VALUE) .setTemplateName(TEMPLATE_NAME_VALUE) + .setOrganization(ORGANIZATION_VALUE) .build()); assertThat(serviceTester.getPostParser()).isNull(); @@ -458,6 +483,7 @@ public class PermissionsServiceTest { .hasParam(PARAM_PERMISSION, PERMISSION_VALUE) .hasParam(PARAM_TEMPLATE_ID, TEMPLATE_ID_VALUE) .hasParam(PARAM_TEMPLATE_NAME, TEMPLATE_NAME_VALUE) + .hasParam(PARAM_ORGANIZATION, ORGANIZATION_VALUE) .andNoOtherParam(); } } |