]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9181 IT to search for provisioned projects
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Mon, 4 Sep 2017 10:02:20 +0000 (12:02 +0200)
committerStas Vilchik <stas.vilchik@sonarsource.com>
Mon, 11 Sep 2017 09:28:29 +0000 (11:28 +0200)
tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectSearchTest.java

index c8c80fb374c361933b1a8f7f01baaba97baaf788..0109913973874684c8aaa50964e51e0b0abf19d1 100644 (file)
@@ -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,