diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-11-29 15:07:50 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2017-12-04 16:02:52 +0100 |
commit | f25ece8fe820b708f08aac652cdda94183bcb2df (patch) | |
tree | bfee02036d06b5f468d906154767f14ac1a6573e /tests | |
parent | 2ba36cab8ba668c3dfa4c6e33399bd076b356adf (diff) | |
download | sonarqube-f25ece8fe820b708f08aac652cdda94183bcb2df.tar.gz sonarqube-f25ece8fe820b708f08aac652cdda94183bcb2df.zip |
SONAR-10074 Add QP actions "delete" and "associateProjects"
In api/qualityprofiles/search, the following actions are now availables :
- delete : Available when not built-it, not default, and have either QP admin permission or have rights to edit
- associateProjects : Available when not default and have either QP admin permission or have rights to edit
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesEditTest.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesEditTest.java b/tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesEditTest.java index 6b6ed149993..9598bb0432f 100644 --- a/tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesEditTest.java +++ b/tests/src/test/java/org/sonarqube/tests/qualityProfile/QualityProfilesEditTest.java @@ -24,8 +24,8 @@ import java.util.function.Predicate; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.sonarqube.tests.Category6Suite; import org.sonarqube.qa.util.Tester; +import org.sonarqube.tests.Category6Suite; import org.sonarqube.ws.Common; import org.sonarqube.ws.Organizations.Organization; import org.sonarqube.ws.Qualityprofiles.CreateWsResponse; @@ -213,11 +213,12 @@ public class QualityProfilesEditTest { .qProfiles().service().search(new SearchRequest().setOrganizationKey(organization.getKey())); assertThat(result.getActions().getCreate()).isFalse(); assertThat(result.getProfilesList()) - .extracting(SearchWsResponse.QualityProfile::getKey, qp -> qp.getActions().getEdit(), qp -> qp.getActions().getCopy(), qp -> qp.getActions().getSetAsDefault()) + .extracting(SearchWsResponse.QualityProfile::getKey, qp -> qp.getActions().getEdit(), qp -> qp.getActions().getCopy(), qp -> qp.getActions().getSetAsDefault(), + qp -> qp.getActions().getDelete(), qp -> qp.getActions().getAssociateProjects()) .contains( - tuple(xooProfile1.getKey(), true, false, false), - tuple(xooProfile2.getKey(), true, false, false), - tuple(xooProfile3.getKey(), false, false, false)); + tuple(xooProfile1.getKey(), true, false, false, true, true), + tuple(xooProfile2.getKey(), true, false, false, true, true), + tuple(xooProfile3.getKey(), false, false, false, false, false)); } @Test @@ -231,9 +232,10 @@ public class QualityProfilesEditTest { .qProfiles().service().search(new SearchRequest().setOrganizationKey(organization.getKey())); assertThat(result.getActions().getCreate()).isTrue(); assertThat(result.getProfilesList()) - .extracting(SearchWsResponse.QualityProfile::getKey, qp -> qp.getActions().getEdit(), qp -> qp.getActions().getCopy(), qp -> qp.getActions().getSetAsDefault()) + .extracting(SearchWsResponse.QualityProfile::getKey, qp -> qp.getActions().getEdit(), qp -> qp.getActions().getCopy(), qp -> qp.getActions().getSetAsDefault(), + qp -> qp.getActions().getDelete(), qp -> qp.getActions().getAssociateProjects()) .contains( - tuple(xooProfile.getKey(), true, true, true)); + tuple(xooProfile.getKey(), true, true, true, true, true)); } @Test |