diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2017-09-04 12:02:20 +0200 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-09-11 11:28:29 +0200 |
commit | 09e1d1190d89d44d4168996532ee8223e62d87ca (patch) | |
tree | 478a11aac4487fe0a2cc33860b7ca275a3af7e93 /tests/src/test/java/org | |
parent | 513356269ca36067d24db28cfda79630130e8bf1 (diff) | |
download | sonarqube-09e1d1190d89d44d4168996532ee8223e62d87ca.tar.gz sonarqube-09e1d1190d89d44d4168996532ee8223e62d87ca.zip |
SONAR-9181 IT to search for provisioned projects
Diffstat (limited to 'tests/src/test/java/org')
-rw-r--r-- | tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectSearchTest.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectSearchTest.java b/tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectSearchTest.java index c8c80fb374c..01099139738 100644 --- a/tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectSearchTest.java +++ b/tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectSearchTest.java @@ -31,6 +31,7 @@ import org.sonarqube.tests.Tester; import org.sonarqube.ws.Organizations; import org.sonarqube.ws.WsProjects.CreateWsResponse; import org.sonarqube.ws.WsProjects.SearchWsResponse; +import org.sonarqube.ws.client.GetRequest; import org.sonarqube.ws.client.project.SearchWsRequest; import static java.util.Collections.singletonList; @@ -87,6 +88,24 @@ public class ProjectSearchTest { .doesNotContain(anotherProject.getKey()); } + @Test + public void search_provisioned_projects() { + Organizations.Organization organization = tester.organizations().generate(); + CreateWsResponse.Project firstProvisionedProject = tester.projects().generate(organization); + CreateWsResponse.Project secondProvisionedProject = tester.projects().generate(organization); + CreateWsResponse.Project analyzedProject = tester.projects().generate(organization); + + analyzeProject(analyzedProject.getKey(), organization.getKey()); + + String result = tester.wsClient().wsConnector().call(new GetRequest("api/projects/provisioned") + .setParam("organization", organization.getKey())) + .failIfNotSuccessful().content(); + + assertThat(result) + .contains(firstProvisionedProject.getKey(), secondProvisionedProject.getKey()) + .doesNotContain(analyzedProject.getKey()); + } + private void analyzeProject(String projectKey, Date analysisDate, String organizationKey) { runProjectAnalysis(orchestrator, "shared/xoo-sample", "sonar.organization", organizationKey, |