From 09e1d1190d89d44d4168996532ee8223e62d87ca Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Mon, 4 Sep 2017 12:02:20 +0200 Subject: [PATCH] SONAR-9181 IT to search for provisioned projects --- .../ProjectSearchTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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, -- 2.39.5