aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2016-10-25 08:44:10 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2016-10-25 08:44:10 +0200
commitbf710a93db0c13d26691146297558e10299bf0b3 (patch)
treed01b63763508572c4785902f2542fa1578c32f6d /sonar-db
parent1a49feaa758a2e5bc1e0159c61bdbb88b707108b (diff)
downloadsonarqube-bf710a93db0c13d26691146297558e10299bf0b3.tar.gz
sonarqube-bf710a93db0c13d26691146297558e10299bf0b3.zip
Fix quality flaws
Diffstat (limited to 'sonar-db')
-rw-r--r--sonar-db/src/test/java/org/sonar/db/measure/ProjectMeasuresIndexerIteratorTest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/sonar-db/src/test/java/org/sonar/db/measure/ProjectMeasuresIndexerIteratorTest.java b/sonar-db/src/test/java/org/sonar/db/measure/ProjectMeasuresIndexerIteratorTest.java
index 69763cf453e..fb905140373 100644
--- a/sonar-db/src/test/java/org/sonar/db/measure/ProjectMeasuresIndexerIteratorTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/measure/ProjectMeasuresIndexerIteratorTest.java
@@ -110,6 +110,18 @@ public class ProjectMeasuresIndexerIteratorTest {
}
@Test
+ public void does_not_fail_when_quality_gate_has_no_value() throws Exception {
+ MetricDto metric = insertMetric("alert_status", LEVEL);
+ ComponentDto project = newProjectDto();
+ SnapshotDto analysis = componentDbTester.insertProjectAndSnapshot(project);
+ insertMeasure(project, analysis, metric, null);
+
+ Map<String, ProjectMeasures> docsById = createResultSetAndReturnDocsById();
+
+ assertThat(docsById.get(project.uuid()).getMeasures().getNumericMeasures()).isEmpty();
+ }
+
+ @Test
public void does_not_return_none_numeric_metrics() throws Exception {
MetricDto dataMetric = insertMetric("data", DATA);
MetricDto distribMetric = insertMetric("distrib", DISTRIB);