aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2017-11-28 08:54:10 +0100
committerEric Hartmann <hartmann.eric@gmail.Com>2017-12-04 13:44:55 +0100
commit908cb9a5c6f73444e0a60e808f20a15820bb380f (patch)
tree16d8850f9c2204173fff56e250209c58e83f664e /tests
parent70fd4ee3f448a9bd0ce7e97d269b2ca41355a8f0 (diff)
downloadsonarqube-908cb9a5c6f73444e0a60e808f20a15820bb380f.tar.gz
sonarqube-908cb9a5c6f73444e0a60e808f20a15820bb380f.zip
SONAR-10096 Forbid deleting built-in quality gate
Diffstat (limited to 'tests')
-rw-r--r--tests/src/test/java/org/sonarqube/tests/qualityGate/QualityGateTest.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/src/test/java/org/sonarqube/tests/qualityGate/QualityGateTest.java b/tests/src/test/java/org/sonarqube/tests/qualityGate/QualityGateTest.java
index 76f3f677092..718ef39a601 100644
--- a/tests/src/test/java/org/sonarqube/tests/qualityGate/QualityGateTest.java
+++ b/tests/src/test/java/org/sonarqube/tests/qualityGate/QualityGateTest.java
@@ -50,6 +50,7 @@ import org.sonarqube.ws.MediaTypes;
import org.sonarqube.ws.Organizations.Organization;
import org.sonarqube.ws.Projects.CreateWsResponse.Project;
import org.sonarqube.ws.Qualitygates;
+import org.sonarqube.ws.Qualitygates.ProjectStatusResponse;
import org.sonarqube.ws.Users;
import org.sonarqube.ws.client.GetRequest;
import org.sonarqube.ws.client.PostRequest;
@@ -65,6 +66,7 @@ import org.sonarqube.ws.client.qualitygates.UpdateConditionRequest;
import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.groups.Tuple.tuple;
+import static org.sonarqube.ws.Qualitygates.ProjectStatusResponse.Status.ERROR;
import static util.ItUtils.concat;
import static util.ItUtils.extractCeTaskId;
import static util.ItUtils.getMeasure;
@@ -210,11 +212,11 @@ public class QualityGateTest {
String taskId = getTaskIdInLocalReport(projectDir("qualitygate/xoo-sample"));
String analysisId = getAnalysisId(taskId);
- ProjectStatusWsResponse projectStatusWsResponse = tester.wsClient().qualityGates().projectStatus(new ProjectStatusRequest().setAnalysisId(analysisId));
- ProjectStatusWsResponse.ProjectStatus projectStatus = projectStatusWsResponse.getProjectStatus();
- assertThat(projectStatus.getStatus()).isEqualTo(ProjectStatusWsResponse.Status.ERROR);
+ ProjectStatusResponse projectStatusWsResponse = tester.wsClient().qualityGates().projectStatus(new ProjectStatusRequest().setAnalysisId(analysisId));
+ ProjectStatusResponse.ProjectStatus projectStatus = projectStatusWsResponse.getProjectStatus();
+ assertThat(projectStatus.getStatus()).isEqualTo(ERROR);
assertThat(projectStatus.getConditionsCount()).isEqualTo(1);
- ProjectStatusWsResponse.Condition condition = projectStatus.getConditionsList().get(0);
+ ProjectStatusResponse.Condition condition = projectStatus.getConditionsList().get(0);
assertThat(condition.getMetricKey()).isEqualTo("ncloc");
assertThat(condition.getErrorThreshold()).isEqualTo("7");
}